(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-2960223314593660", enable_page_level_ads: true }); Program to find if the given year is a leap year or not - TecGlance

Header Ads

Program to find if the given year is a leap year or not



========================== LEAP YEAR =====================



 a=input("Enter a YEAR :")

 if a%4==0:

     if a%100==0:

         if a%400==0:

             print a,"is a Leap Year"

         else:

             print a,"is Not a Leap Year"

     else:

          print a,"is a Leap Year"

 else:

     print a,"is NOT a Leap Year"





================== OUTPUT ============================



 Enter a YEAR :2016

 2016 is a Leap Year



================== OUTPUT ============================



 Enter a YEAR :1900

 1900 is Not a Leap Year



======================================================

No comments

Powered by Blogger.