Answer:
The program in Python is as follows:
year = int(input("Year: "))
print(year,end=" ")
if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
print("is a leap year")
else:
print("is not a leap year")
else:
print("is a leap year")
else:
print("is not a leap year")
Step-by-step explanation:
This gets input for year
year = int(input("Year: "))
This prints the year, input by the user
print(year,end=" ")
Check if year is divisible by 4 --- step 1
if (year % 4) == 0:
If step 1 is true, check if year is divisible by 100 -- step 2
if (year % 100) == 0:
If step 2 is true, check if year is divisible by 400 -- step 3
if (year % 400) == 0:
If yes, print leap year --- step 4
print("is a leap year")
else:
If otherwise, print not leap year --- step 5
print("is not a leap year")
If step 3 is not true, print leap year
else:
print("is a leap year")
If step 1 is not true, print not leap year
else:
print("is not a leap year")