A Pseudocode Sample To Accept A Year From The User And Determine Whether Is A Leap Year?

1

1 Answers

Oddman Profile
Oddman answered
Century years not divisible by 400 are not leap years. Otherwise, years divisible by 4 are leap years.

Read x;
If( (x > 0) && ((x%400 == 0) || ((x%100 != 0) && (x%4 == 0))) ) Print x, " is a Leap Year";
Else Print x, " is NOT a Leap Year";

Answer Question

Anonymous