Twist_Nemo

Check a Number is even or odd in c

Mar 16th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3.  
  4.     int num;
  5.    printf("Enter your number: \n");
  6.     scanf("%d", &num);
  7.    
  8.     if (num % 2 != 0) {
  9.      
  10.         printf("Your number is odd \n");
  11.        
  12.        
  13.       }
  14.         else {
  15.           printf("Your number is even \n");
  16.         }
  17.    
  18. return 0;
  19.  
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment