#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf("Enter any number");
scanf("%d",&a);
if(a%2==0)
{
printf("It is an even number");
}
else
{
printf("It is an odd number");
}
getch();
}
Code to check leap year #include<stdio.h> #include<conio.h> void main() { int a; printf("Enter year"); scanf("%d",&a); if(a%4==0) { printf("It is a leap year"); } else { printf("It is not a leap year"); } getch(); } OUTPUT
Comments
Post a Comment