PROGRAM TO FIND THE YEAR IS LEAP YEAR OR NOT:
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("enter the year = ");
scanf("%d",&n);
if(n%400==0)
{
if(n%100==0)
printf("leap year\n");
else
printf("not a leap year\n ");
}
else
{
if(n%4==0)
printf("leap year ");
else
printf("not a leap year");
}
getch();
}
-------------------------------------------------------------------------------------
OUTPUT :
enter the year = 2020
leap year.
Comments
Post a Comment