Tuesday, 4 October 2011

C program to find given year is leap year or not.......


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

void main()
{
int yr;
clrscr();
printf("\n Enter a year: ");
scanf("%d",&yr);
if ( yr %100 == 0)
{
if( yr %400 == 0)
{
printf("\n Leap Year ");
}
else
{
printf("\n Not Leap Year ");
}
}
else
{
if (yr %4 ==0)
{
  printf("\n Leap Year ");
}
else
{
printf("\n Not Leap Year ");
}
}
getch();
}

1 comment:

  1. Harrah's Cherokee Casino & Hotel - Mapyro
    Harrah's Cherokee Casino & Hotel in Cherokee, NC - 광주 출장샵 See 안산 출장샵 14 photos and 5 tips from 남원 출장샵 3252 visitors to Harrah's Cherokee Casino & Hotel. "Nice place to stay" 안산 출장샵 Rating: 군산 출장안마 3.9 · ‎4,254 votes

    ReplyDelete