how to say wether ours leap year or not in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how to say wether ours leap year or not in java

19th Aug 2018, 5:50 AM
D Dheeraj
D Dheeraj - avatar
13 Answers
0
if (year % 4 == 0) { // This code will be executed if it is a leap year }
19th Aug 2018, 8:26 AM
ReimarPB
ReimarPB - avatar
+ 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.
20th Aug 2018, 1:43 AM
Rugved Modak
Rugved Modak - avatar
+ 1
bro reimarpb can you plz explain me bro
19th Aug 2018, 8:29 AM
D Dheeraj
D Dheeraj - avatar
+ 1
thanks bro I followed you
19th Aug 2018, 8:33 AM
D Dheeraj
D Dheeraj - avatar
+ 1
where do u live
19th Aug 2018, 8:35 AM
D Dheeraj
D Dheeraj - avatar
+ 1
where do u live bro
19th Aug 2018, 8:40 AM
D Dheeraj
D Dheeraj - avatar
+ 1
Check if it divides by 4.
19th Aug 2018, 8:54 AM
Rusty.Metal
+ 1
I tried it bro it works thanks and where do u live
19th Aug 2018, 8:54 AM
D Dheeraj
D Dheeraj - avatar
+ 1
ohh I thought we can make a project together
19th Aug 2018, 10:07 AM
D Dheeraj
D Dheeraj - avatar
19th Aug 2018, 8:32 AM
ReimarPB
ReimarPB - avatar
0
Dheeraj.D np and thanks for the follow 👍
19th Aug 2018, 8:34 AM
ReimarPB
ReimarPB - avatar
0
Dheeraj.D I live in Denmark, why?
19th Aug 2018, 9:55 AM
ReimarPB
ReimarPB - avatar
0
Rugved Modak oh I didn't know that
20th Aug 2018, 4:50 AM
ReimarPB
ReimarPB - avatar