Saturday, June 29, 2013

Write a C program to check odd or even.



#include<stdio.h>

void main()
{
   int n;

   printf("Enter an integer\n");
   scanf("%d",&n);

   if ( n%2 == 0 )
      printf("Even");
   else
      printf("Odd");
}

No comments:

Post a Comment