Advertisement
tonygms3

Mid: Question number 6.

Nov 14th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6. void check(int num)
  7. {
  8.     if(num>=0 && num<=25)
  9.     {
  10.         if(num%2==0)
  11.         {
  12.             printf("%d is an even number\n",num);
  13.         }
  14.         else
  15.         {
  16.             printf("%d is an odd number\n",num);
  17.         }
  18.     }
  19.     else
  20.     {
  21.         printf("Wrong Input\n");
  22.     }
  23. }  
  24. int main()
  25. {
  26.     int num;
  27.    
  28.     printf("Enter Number\n");
  29.     scanf("%d",&num);
  30.     check(num);
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement