C Program to Check for Leap Year/Leap Year Generation
This is the C program to check whether a given year is leap year or not.the second program generates leap year within the limit specified
#include<stdio.h>
main()
{
int year;
printf("Enter a year n");
scanf("%d",&year);
if(year%400==0||year%4==0)
printf("LEAP YEAR n");
else
printf("NOT A LEAP YEAR n");
}
Leap Year Generation:
#include<stdio.h>
main()
{
int i;
for(i=1990;i<=3000;i++)
if(i%400==0||i%4==0)
printf("%dn",i);
}
Recent Comments