Write a program in C to check a given year is leap year or not.
#include<stdio.h>
#include<conio.h>
void main()
{
int y;
clrscr();
printf("Enter a year:-");
scanf("%d",&y);
if(y%100!=0&&y%400==0||y%4==0)
printf("%d is leap year\n",y);
else
printf("%d is not leap year\n",y);
getch();
}
0 Comments