//Program to check
whether the entered year is a leap year or not
#include
<stdio.h>
#include
<conio.h>
void
main()
{
int year; //Declaration of variable year
clrscr();
printf("\nEnter any year\n");
scanf("%d", &year);
if ( year%4 == 0) //check whether the value of year after
dividing by 4 gives the remainder as zero or not
printf("The entered year %d is a leap year\n", year);
else
printf("The entered year %d is not a leap year\n", year);
getch();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.