What is the condition to find leap year | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

What is the condition to find leap year

20th Jan 2017, 7:56 PM
Pragati Porwal
Pragati Porwal - avatar
2 Antworten
+ 1
Java method, just translate it to C# private boolean isLeapYear(int year){ if (year % 4 == 0){ if (year % 100 == 0) if (year % 400 == 0) return true; else return false; else return true; }else { return false; } }
20th Jan 2017, 8:02 PM
Uran Kajtazaj
Uran Kajtazaj - avatar
0
For the c# equivalent; public static bool IsLeapYear( int year )
20th Jan 2017, 9:29 PM
Aaron
Aaron - avatar