Advertisement
rafikamal

Determine If a Number is Odd or Even

Jan 3rd, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.15 KB | None | 0 0
  1. #include <stdio.h>
  2.        
  3. int main()
  4. {
  5.     int x;
  6.    
  7.     scanf("%d", &x);
  8.    
  9.     if(x % 2 == 0)
  10.         printf("Even");
  11.     else
  12.         printf("Odd");
  13.        
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement