Advertisement
arfin97

1074 - Even or Odd

Nov 1st, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3.     int a,x,n;
  4.     scanf("%d",&a);
  5.     for(x=1; x<=a; x++) {
  6.         scanf("%d",&n);
  7.         if(n==0) {
  8.             printf("NULL\n");
  9.         } else if(n%2==0&&n>0) {
  10.             printf("EVEN POSITIVE\n");
  11.         } else if(n%2==0&&n<0) {
  12.             printf("EVEN NEGATIVE\n");
  13.         } else if(n%2==1&&n>0) {
  14.             printf("ODD POSITIVE\n");
  15.         } else if(n%2==-1&&n<0) {
  16.             printf("ODD NEGATIVE\n");
  17.         }
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement