+ 1
how to say wether ours leap year or not in java
13 ответов
0
if (year % 4 == 0) {
// This code will be executed if it is a leap year
}
+ 2
ReimarPB if the year is multiple of 100 but not multiple of 400 then it is not a leap year. Ex 1900 is divisible by 100 but not by 400 so it is not a leap year. But 2000 is divisible by 400 too, so it is a leap year.
+ 1
bro reimarpb can you plz explain me bro
+ 1
thanks bro I followed you
+ 1
where do u live
+ 1
where do u live bro
+ 1
Check if it divides by 4.
+ 1
I tried it bro it works thanks and where do u live
+ 1
ohh I thought we can make a project together
0
Dheeraj.D
Click here and go to the third page:
https://www.sololearn.com/learn/Java/2140/?ref=app
0
Dheeraj.D np and thanks for the follow 👍
0
Dheeraj.D I live in Denmark, why?
0
Rugved Modak oh I didn't know that