How to check leap year using java and C#
Hi there, it's quite complicated to check using the if-else statement the year is a leap year or not. Today I will show the example of how to check if the year is a leap year or not. Leap Year A Normal day for a year is 365 days Leap year have 366 days (29 days in February) How to know if the year is a leap year A leap year can be any year that can be divided by 4 without any balance. WHY leap year occur This is because according to research, The earth rotates about 365.242375 but in one year only have 365 days. So something has to be done to handle the remaining 0.242375 balance. that is why the leap year occurs only once in 4 years. The example is pretty easy to follow. The Java Application package leapyear; import java.util.Scanner; public class LeapYear { public static void main(String[] args) { String Cont = "Y"; Scanner input = new Scanner(System.in); ...