google-site-verification: googlef8aa845b858144d3.html COMPUTER SCIENCE NOTES: Leap Year: (Example 2) This program checks whether year is a leap year ...

Friday, March 3, 2017

Leap Year: (Example 2) This program checks whether year is a leap year ...


/* program to find whether a year is leap or not */
#include<stdio.h>
#include<conio.h>
void main()
{
int year;
printf("Enter year :");
scanf("%d",&year);
if(year%100==0)
{
if(year%400==0)
printf("Leap year \n");
else
printf("Not leap year \n");
}
else
{
if(year%4==0)
printf("Leap year \n");
else
printf("Not leap year \n");
}
getch();
}




No comments:

Post a Comment