Saturday, 23 September 2017

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(“nLeep Year”);
else
printf(“nNot leap year”);
getch(); //to stop the screen
}

0 comments:

Post a Comment

Tech UOG