Advertisement
Programmin-in-Python

C Program to find if the given number is even or odd

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