Answers for "give the year and check if the leap year are not in java"

0

Leap year or not program in java using if-else

import java.util.Scanner;public class Main{public static void main(String[] args){int year;System.out.println("Enter the year");Scanner sc = new Scanner(System.in);year = sc.nextInt();if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0))System.out.println("it is a leap year");elseSystem.out.println("it is not a leap year");}}
Posted by: Guest on June-12-2021

Code answers related to "give the year and check if the leap year are not in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language