Write a C Program to find whether the entered number is even, odd.

Write a C Program to find whether the entered number is even, odd .
#include<stdio.h>
#include<conio.h>
 
void main()
{          int a;
            clrscr();
            printf(“Enter a number:”);
            scanf(“%d”,&a);
            printf(“%d”,a%2==0);          // 1->the no. is even, 0->odd
            getch();
}
 
Output:

You may also like...

Leave a Reply