Showing posts with label c language. Show all posts
Showing posts with label c language. Show all posts
Wednesday, 14 November 2012
LEAP YEAR PROGRAM IN C LANGUAGE
#include<stdio.h>
void main()
{
int y;
printf("enter the year:\t");
scanf("%d",&y);
if(y%100==0)
{
if(y%400==0)
{
printf("%d is leap year");
}
else
{
printf(" %d is not a leap year");
}
}
else
{
if(y%4==0)
{
printf("%d is a leap year");
}
else
{
printf("%d is not a leap year");
}
}
}
OUTPUT:
enter the year: 100
100 is not a leap year
Labels:
c language,
Leap Year program
Subscribe to:
Posts (Atom)