Since 1582 are leap years those years divisible by 4, except for century years (equal to
100*S) where S is not divisible by 4.
Example :
1988, 1600, 2000 are leap years.
1987, 1700, 1800, 1900 are not.
Write a program that reads a year and displays the caracter Y if the year is a leap and N if it's not, followed by a new line.
Difficulty level

This exercise is mostly suitable for students
#include <stdio.h>
#include <math.h>
int main()
{
double km, inches;
int m, y , f;
scanf("%lf",&km);
m = km *1000 / 1609;
y = (km *1000 -m*1609) * 1760 / 1609;
f = ((km *1000 -m*1609) * 1760 / 1609 - y )*3;
inches= (((km *1000 -m*1609) * 1760 / 1609 - y )*3 -f)*12;
printf("%d %d %d %.2lf\n",m , y, f , inches);
return 0;
}
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
