A year is leap year if it divisible by 4, except that years divisible by 100
are not leap years unless they are also divisible by 400. Write a program
that ask the user for a year and printout whether it is a leap year or not.
Answers
Answered by
8
Answer:
#include<stdio.h>
void main()
{
int year;
printf("Enter your year");
scanf("%d",&year)
if(year%400==0)
printf("Leap year");
else if(year%100==0)
printf("Not leap year");
else if(year%4==0)
printf("Leap year);
else
printf("Not leap year);
}
Similar questions