Hacker Culture
Softwares, C programs, Tricks & Tricks
Pages
Home
C Programs
Tips & Tricks
Downloads
About
Ubqar.org
Monday 15 February 2016
Checking a number if it is Even or Odd using Bitwise Operator in C
#include <stdio.h>
#include <stdlib.h>
int main()
{
int num;
printf("Enter a number: ");
scanf("%d", &num);
if(num&1)
printf("%d is ODD\n", num);
else
printf("%d is EVEN\n", num);
system("pause");
return 0;
}
Output"
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment