Problem Link
Solution :
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int count=0,n,a,b,i,j; | |
while(scanf("%d",&n)==1){ | |
while(count<=5){ | |
if(n%2==1){ | |
count++; | |
printf("%d\n",n); | |
} | |
n++; | |
} | |
count=0; | |
} | |
return 0; | |
} |
Problem : 1074 Even or Odd
Problem Link :
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int n,i,j,a,b,sum=0; | |
while(scanf("%d",&n)==1){ | |
for(i=1;i<=n;i++){ | |
scanf("%d",&a); | |
if(a==0){ | |
printf("NULL\n"); | |
} | |
else if(a%2==0 && a<0){ | |
printf("EVEN NEGATIVE\n"); | |
} | |
else if(a%2==0 && a>0){ | |
printf("EVEN POSITIVE\n"); | |
} | |
else if(a%2!=0 && a>0){ | |
printf("ODD POSITIVE\n"); | |
} | |
else{ | |
printf("ODD NEGATIVE\n"); | |
} | |
} | |
} | |
return 0; | |
} | |