Question: Determining a leap year This program first prompts the user to enter a year as an int value and checks if it is a leap
Determining a leap year
This program first prompts the user to enter a year as an int value and checks if it is a leap year.
A year is a leap year if it is divisible by but not by or it is divisible by
Use input to take the user input the year, ie and convert it with int
Use to see if a number x is divisible by an other number y if xy returns then x is divisible by y
Check if the year is divisible by AND not divisible by
OR check if the year is divisible by
Use print
Exercise :
Display leap years
Write a program that displays, ten per line, all the leap years in the twentyfirst century from year to The years are separated by exactly one space.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
