Search (Article Or Program)

18 June 2011

Tell weather a number is odd or even (in C)

/*Tell weather a number is odd or even:*/
#include
#include
main()
{
clrscr();
int n;
printf("Please enter an integer: ");
scanf("%d",&n);
if(n%2!=0)
printf("%d is odd\n",n);
else
printf("%d is even\n",n);
getch();
}