google-site-verification: googlef8aa845b858144d3.html COMPUTER SCIENCE NOTES: Leap Year: (Example 1)C program to check if a given year is leap year or...

Friday, March 3, 2017

Leap Year: (Example 1)C program to check if a given year is leap year or...




/*find a year is lear or not */
#include<stdio.h>
#include<conio.h>
void main()
{
int year;
clrscr();
printf("Enter a year : ");
scanf("%d",&year);
if(year%4==0 &&(year%100!=0 || year%400==0))
printf("This is leap year ");
else
printf("This is not leap year ");
getch();
}

No comments:

Post a Comment