Solved

A Leap Year Occurs When the Year Number Is Divisible

Question 60

Essay

A leap year occurs when the year number is divisible by 4.But there is a special case for years ending in 00: these must be divisible by 400 to be considered a leap year.Thus,1900 was not a leap year,but 2000 was.Write an if-statement that determines if the integer variable year represents a leap year.(Hint: use the % operator for taking remainders. )

Correct Answer:

verifed

Verified

if (year % 100 == 0 && year % ...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents