Answers for "how to check if the number is even or odd using bitwise operator"

C++
0

how to check if the number is even or odd using bitwise operator

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int num;
	cin>>num;
	if(num & 1){
		cout<<"odd";
	}
	else{
		cout<<"even";
	}
	return 0;
}
Posted by: Guest on May-27-2021

Code answers related to "how to check if the number is even or odd using bitwise operator"

Browse Popular Code Answers by Language