Computer Science, asked by shalini683, 1 year ago

using scanner class method


it is java program





Please answer it correctly

I will mark you as brainlist

Please answer it very fast

Attachments:

Answers

Answered by Avinash1116
1
import java.util.Scanner;
class Year
{
public static void main()
{
Scanner obj =new Scanner(System.in);
System.out.println("Enter a year");
int n=obj.nextInt();
if(n%100==0 && n%4==0)
{
System.out.println("It is a century leap year");
}
else if(n%4==0 && n%100!=0)
{
System.out.println("It is a leap year");
}
else if( n%100==0 && n%4!= 0)
{
System.out.println(" It is a century year but not a leap year");
}
}
}

Answered by ashish55587
1

I HOPE IT HELP YOU

❤❤❤@Ashish❤❤❤
Attachments:
Similar questions