Advertisement
rajuahammad73

Write a C program to check whether a number is even or odd.

Jun 27th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. // Write a C program to check whether a number is even or odd.
  2.  
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.     int a;
  8.    
  9.     printf("Giver Your Number\n");
  10.    
  11.     scanf("%d", &a);
  12.    
  13.     if(a%2==0){
  14.         printf("%d is Even", a);
  15.     } else {
  16.         printf("%d is Odd", a);
  17.     }
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement