Write an algorithm and draw a flowchart to check if an entered year is a leap year or not. A year is a leap year if the following conditions are satisfied: “The year is multiple of 4 and not multiple of 100.”
Answers
Answered by
0
Explanation:
If the year is evenly divisible by 4, go to step 2. ...
If the year is evenly divisible by 100, go to step 3. ...
If the year is evenly divisible by 400, go to step 4. ...
The year is a leap year (it has 366 days).
The year is not a leap year (it has 365 days).
Answered by
0
Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter year");
int year = sc.nextInt();
if(year%4 == 0){
System.out.println("It is a leap year");
}
else{
System.out.println("It is not a leap year");
}
}
}
Explanation:
Similar questions