Sunday, February 21, 2016

URI 1074 - Even or Odd

#include <stdio.h>

int main() {

   int i,n;
   int b;
   scanf("%d",&n);
   for(i=1; i<=n; i++){
       scanf("%d",&b);
       if(b%2==0 && b>0)printf("EVEN POSITIVE\n");
       if(b%2==0 && b<0)printf("EVEN NEGATIVE\n");
       if(b%2!=0 && b>0)printf("ODD POSITIVE\n");
       if(b%2!=0 && b<0)printf("ODD NEGATIVE\n");
       if(b==0)printf("NULL\n");
   }

    return 0;
}

No comments:

Post a Comment

Thank you for commenting. Please wait for response :)