SHARE
TWEET

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

rajuahammad73 Jun 27th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top