Advertisements
Advertisements
प्रश्न
Write a program to check if the year entered by the user is a leap year or not.
टिप्पणी लिखिए
Advertisements
उत्तर
The year is a leap year if it is divisible by 4.
Program:
year = int(input("Enter the year: "))
if(year % 4 == 0):
print("The year",year," is a leap year.")
else:
print("The year",year," is not a leap year.")
OUTPUT:
Enter the year: 2020
The year 2020 is a leap year.shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
