saimun1

C programming Odd or Even

Apr 24th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main (int argc, char *argv[])
  4. {
  5.  
  6.   int number = 0;
  7.   printf("Enter a number");
  8.   scanf("%d", &number);
  9.   if(number%2 == 0) {
  10.    printf("The number is even");
  11.   }
  12.   else {
  13.    printf("The number is odd");
  14.   }
  15.  
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment