Question: IN JAVA ......... A year with 366 days is called a leap year. A year is a leap year if it is divisible by 4
IN JAVA .........
A year with 366 days is called a leap year. A year is a leap year if it is divisible by 4 (for e.g., 1980), except that it is not a leap year if it is also divisible by 100 (for e.g., 1900); however, it is a leap year if it is further divisible by 400 (for e.g., 2000). Write a program that prompts the user to enter a year and displays whether that year is a leap year. The program should repeatedly prompt the user for a year until the user enters a sentinel value of -99 to quit the program. Note that you will need to use the modfunction (%) to determine divisibility by a number. You CANNOT use the class Gregorian Calendar and any of its methods.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
