Advertisement
PROFESSOR_AIH

Even or Odd

Mar 29th, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int n,num,i;
  5.     scanf("%d",&n);
  6.     for(i=1; i<=n; i++)
  7.     {
  8.         scanf("%d",&num);
  9.         if(num%2==0 && num>0)
  10.         {
  11.             printf("EVEN POSITIVE\n");
  12.         }
  13.         else if(num%2==0 && num<0)
  14.         {
  15.             printf("EVEN NEGATIVE\n");
  16.         }
  17.         else if(num%2!=0 && num>0)
  18.         {
  19.             printf("ODD POSITIVE\n");
  20.         }
  21.         else if(num%2!=0 && num<0)
  22.         {
  23.             printf("ODD NEGATIVE\n");
  24.         }
  25.         else if(num==0)
  26.         {
  27.             printf("NULL\n");
  28.         }
  29.         num=0;
  30.     }
  31.  
  32.     return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement