//program
to find whether a number is odd or even
by using bitwise AND operator
void
main()
{
int
a=1,num;
clrscr();
printf("Enter
any number ");
scanf("%d",num);
if((num
& a)==0)
printf("Number
is even");
else
printf("Number
is odd");
getch();
}
Output
Enter
any number 25
Number is odd
No comments:
Post a Comment