Saturday, August 20, 2011

Program to check wheather the given year is leap year or not.


//Program to check wheather the given year is leap year or not.
#include<stdio.h>
#include<conio.h>
void main()
{
 int year;
 clrscr();
 printf("To check wheather the given year is leap year or not");
 printf("\nPlease enter the year:");
 scanf("%d",&year);
 if(year%100==0)
 {
  if(year%400==0)
  {
  printf("\nThe entered year (%d) is leap year",year);
  }
  else
  {
   printf("\nThe entered year (%d) is not leap year",year);
   getch();
   exit();
  }
 }
 else
 {
 if(year%4==0)
  {
   printf("\nThe entered year (%d) is leap year",year);
  }
  else
  {
   printf("\nThe entered year (%d) is not leap year",year);
  }
 }
getch();
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More