Write a program to input year and check whether it is:
(a) a Leap year (b) a Century Leap year (c) a Century year but not a Leap year
Answers
Answered by
5
Answer:
please mark branlist answer please
this is java program
Explanation:
import java.util.*;
import java.lang.*;
import java.io.*;
class LeapYear {
static int year; static Scanner inp;
public static void main (String[] args) throws java.lang.Exception {
inp = new Scanner(System.in);
year = Integer.parseInt(inp.next());
if (year % 4==0) {
if (year % 400==0) System.out.println(year + "is a century leap year");
else if (year % 100==0) System.out.println(year + " is not a leap year");
else System.out.println(year + " is a leap year");
}
else System.out.println(year+ " is not a leap year");
}
}
Answered by
2
Answer:
I am nishant studying in 8th std
Similar questions