Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java / / if year is divisble by 4 if ( year % 4 = = 0 ) { / / if year is divisble
java if year is divisble by
ifyear
if year is divisble by it should also be divisble by
if year
it's a leap year since it is divisible by
if year
isLeapYear true;
else it is century year but not divisible by so not a leap year
else
isLeapYear false;
it is not a century year but divisible by so it's a leap year
else
isLeapYear true;
not divisible by so it is not a leap year
else
isLeapYear false;
displaying if it is a leap year or not
ifisLeapYear
System.out.printlnyear leap year";
else
System.out.printlnyear not a leap year";
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started