C program to check if the supplied year is leap year or not.
Write a C program to check if the supplied year is leap year or not.
This C program check if the supplied year is leap year or not.
C Program source code
#include<stdio.h>
#include<conio.h>
int main()
{
int y;
printf("Enter a year:\n");
scanf("%d",&y);
if(y%400==0)
{
printf("Its a leap year.");
}
else if(y%100==0)
{
printf("Its not a leap year,");
}
else if(y%4==0)
{
printf("Its a leap year,");
}
else
{
printf("Its not a leap year,");
}
getch();
return(0);
}
You can Browse related article below for more information and program code related to different math operation.
Does above is helpful , Post you views in comment
Comments
Post a Comment