Welcome to my blog this is test

28 June 2012

4. write a C program to determine whether the no. is even or odd


//Code:

#include
#include
 void main()
  {
   int a,even,odd;
   clrscr();
   printf("\n Enter the positive integer : ");
    scanf("%d",&a);
       if(a%2==0)
         printf("\n The number is even");
       else
         printf("\n The number is odd");
   getch();
  }


/*Output:
Enter the positive integer : 23
The number is odd
Enter the positive integer : 12
The number is even

No comments:

Post a Comment