7.1 Check if a year is a leap year

Scratch solution

View solution

This is just one of many possible solutions:

whenclickedaskEnter the year and I will tell you if it's a leap year or not:andwaitsetyeartoanswerifnotyearmod4=0thensayjoinyear is not a leap year!elseifnotyearmod100=0thensayjoinyear is a leap year!elseifnotyearmod400=0thensayjoinyear is not a leap year!elsesayjoinyear is a leap year!

Back to programming challenge