C program to check odd or even using bitwise operator

#include<stdio.h>
 #include<conio.h>
main()
{
int n;

printf("Enter an integer\n");
scanf("%d",&n);

if ( n & 1 == 1 )
printf("Odd\n");
else
printf("Even\n");

return 0;
}

0 comments:

Post a Comment