C Program to Check Whether a Year is Leap Year or Not Using If Else ?
Q:- Write a C Program to Check Whether a Year is Leap Year or Not Using
If Else ?
Input
#include<stdio.h>
#include<conio.h>
int main()
{
int year;
clrscr();
printf(“Enter a Year =”);
scanf(“%d”,&year);
if(year % 4==0)
{
printf(“%d is Leap Year.”,year);
}
else
{
printf(“%d is not Leap Year.”,year);
}
getch();
}
Output
Enter a
Year = 2016
2016 is
Leap Year.
Comments
Post a Comment