find even odd using & operator

int main()
{
int i =0;
for(i=1;i<10;i++)
{
(i& 1)? printf("Odd"): printf("Even");
  printf("\n");
}
return 0;
}

Comments

Popular posts from this blog

BYTE STUFFING PROGRAM USING C

Rotate a matrix 270 degree AntiClockWise

Finding the length of connected cells of 1's (regions) in an matrix of 1's and 0's