Computer Science, asked by sankalitadas19, 10 months ago

Write a JAVA program using Scanner class to find out os the given year leap year or not.

Answers

Answered by ravikantoct2004
1

import java.util.*;

class one

{

public static void main (int n)

{

int b;

System.out.println ("Input years');

Scanner Sc = new Scanner (System.in);

for (int x=1;x<=n;x++)

{

b = Sc.nextInt();

if (b%4==0)

{

System.out.println("It is a leap year");

}

else

{

System.out.println("It is not a leap year");

}

}

}}

Similar questions