Just cant figure out how to formulate the correct syntax..I can do it in looping statement but my professor said that use only the simple if-else statement. The problem goes like this..Write a program that will determine if the number that you entered is either odd or even number..
I tried writing this code..
#include<stdio. h>
main()
{
int nos;
clrscr();
printf("Enter number:");
scanf("%d",&nos );
if(nos++){
printf("Odd number");
}
else {
printf("Even number");
}
getch();
}
I tried writing this code..
#include<stdio. h>
main()
{
int nos;
clrscr();
printf("Enter number:");
scanf("%d",&nos );
if(nos++){
printf("Odd number");
}
else {
printf("Even number");
}
getch();
}
Comment