3 Answers
#include
#include
void main()
{
int x,y;
clrscr();
printf("Enter a Number:");
scanf("%d",&x);
y=x%2;
if(y==0)
{
printf("\nYou entered an even number");
printf("\n and the number is %d",x);
}
else
{
printf("\n You entered an odd number");
printf("\n and the number is %d",x);
}
getch();
}
3184 views
Answered
#include
#include
int main()
{
int n;
long long inum;
scanf("%d", &n);
while(n--)
{
scanf("%lld", &inum);
if(inum == 0 || inum % 2 == 0)
{
printf("even\n");
}
else
{
printf("odd\n");
}
}
return 0;
}
3184 views
Answered
