Program to find out if a number is odd or even in C

#include <stdio. h>
int main()
{ 
int x;
   printf(“Enter the number: \n”) ;
   scanf(“%d”,&x) ;
if(x%2)
   printf(“\nThe number is odd.\n”) ;
else
   printf(“\nThe number is even. \n”) ;
return 0;
}

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.