Computer Science, asked by btyneha15, 3 months ago

write a program to check whether a given year is leap year​

Answers

Answered by SherwinVincent
5

Answer:

PYTHON

# Python program to check if year is a leap year or not

year = 2000

# To get year (integer input) from the user

# year = nit(input("Enter a year: "))

if (year % 4) == 0:

  if (year % 100) == 0:

      if (year % 400) == 0:

          print("{0} is a leap year". Format(year))

      else:

          print("{0} is not a leap year". Format(year))

  else:

      print("{0} is a leap year". Format(year))

else:

  print("{0} is not a leap year". Format(year))

Output

2000 is a leap year

Similar questions