In this C program we will check if a number is Odd or Even Number using Bitwise Operator and then we will print the result on the screen. The Number will be taken from the user.color>
input:
The Number (integers) (i.e. 5,10,7 etc.)output:
The Number is Odd or Even, will be printed on the screen.CODE---->
#include
int main()
#include
{
//checking a Number is odd or even using bitwise operator
int x,y;
printf(" Please, Enter the Number : ");
scanf("%d",&x);
y=x&1;
if(y==1)
printf("\n %d is a Odd Number.",x);
else
printf("\n %d is Even Number.",x);
return 0;
}
color>