WAP to check whether the given year is a leap year or not ?
Answers
Answered by
6
//
class leap
{
public static void main(int y)
{
int l= y%4;
If(l==0);
System. Out. Println("it is a leap year"+y);
else
System. Out. Println("it is not a leap year"+y);
}}
class leap
{
public static void main(int y)
{
int l= y%4;
If(l==0);
System. Out. Println("it is a leap year"+y);
else
System. Out. Println("it is not a leap year"+y);
}}
Abhishek18111:
its wrong !
Answered by
1
import java.util.*;
public class check
{
public static void main ()
{
Scanner in = new Scanner(System.in);
System.out.println("Enter the year");
int n=in.nextInt();
int r=n%10;
int s=r%4;
if(s==0)
System.out.println("The year is leap year");
else
System.out.println("The year is not a leap year");
}
}
public class check
{
public static void main ()
{
Scanner in = new Scanner(System.in);
System.out.println("Enter the year");
int n=in.nextInt();
int r=n%10;
int s=r%4;
if(s==0)
System.out.println("The year is leap year");
else
System.out.println("The year is not a leap year");
}
}
Similar questions