determine given number N is even or odd by bit manupulation
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
if(n&1)cout<<"Odd\n";
else cout<<"even\n";
return 0;
}
determine given number N is even or odd by bit manupulation
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
if(n&1)cout<<"Odd\n";
else cout<<"even\n";
return 0;
}
0 Comments