Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Odd or Even Number Checking using Bitwise Operator in C-Language




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
#include
int main()
{

//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;
}





Don't just read, write it, run it.....color>

RESULT:color>





This post first appeared on ProgramJoy.blogspot.com, please read the originial post: here

Share the post

Odd or Even Number Checking using Bitwise Operator in C-Language

×

Subscribe to Programjoy.blogspot.com

Get updates delivered right to your inbox!

Thank you for your subscription

×