Search This Blog

Wednesday, July 27, 2011

leap year or not


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


using namespace std;
int main()
{
   /* declarations */
   int year;
 
   printf ("Enter the year : ");
   scanf ("%d", &year);
   printf ("Year entered: %d\n", year );
 
 
if(year % 4 == 0)
printf("the year is a leap year \n");
 else
 
printf("the year is not a leap year \n");

getch();

return (0);
}

No comments:

Post a Comment