Thursday, February 12, 2015

C program to find out whether a given year is a leap year or not



#include<stdio.h>
#include<conio.h>

void main()
{
int year;
clrscr(); //to clear the screen

printf("Enter any year(4-digit):");
scanf("%d",&year);

if(year%100==0)
{
  if(year%400==0)
     printf("Leap Year");
}
else
  if(year%4==0)
printf("
Leep Year");

else
printf("
Not leap year");

getch(); //to stop the screen
}

No comments:

Post a Comment