Cassiniâ €™ s Identity | C ++ implementation to demonstrate working of CassiniaTMs Identity ; Returns ( - 1 ) ^ n ; Driver program
#include <bits/stdc++.h> NEW_LINE using namespace std ; int cassini ( int n ) { return ( n & 1 ) ? -1 : 1 ; } int main ( ) { int n = 5 ; cout << cassini ( n ) ; return 0 ; }