Check if a number is even or odd without using any arithmetic operator
#include<stdio.h>
int main()
{
int i,j,k,l;
int n;
printf("Enter the number to be checked even or odd\n");
scanf("%d",&n);
if((n&1)==0)
{
printf("This is even number\n");
}
else
{
printf("This is odd number\n");
}
return 0;
}
No comments:
Post a Comment