URI Online Judge Solution 1074 - Solution in C








Solution in C

#include<stdio.h>
int main()
{
int i,n;
scanf("%d",&n);
if(n<10000)
{
int a[n];
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(a[i]>0&&a[i]%2==0)
{
printf("EVEN POSITIVE\n");
}
else if(a[i]<0&&a[i]%2==0)
{
printf("EVEN NEGATIVE\n");
}
else if(a[i]>0&&a[i]%2!=0)
{
printf("ODD POSITIVE\n");
}
else if(a[i]<0&&a[i]%2!=0)
{
printf("ODD NEGATIVE\n");
}
else
{
printf("NULL\n");
}
}
}
return 0;
}






~~~~~~Happy Coding~~~~~~

No comments

Powered by Blogger.