WAP to find if a given year is a leap year or not without using logical operators in java
Answers
Answered by
0
Answer:
public class Leapyear {
public static void main(string [ ] args){ into year;
system .out .print1n("enter the year : :");
scanner sc = new scanner(system.in);
year = sc.nextInt();
if (((year %4 ==0 ) &&(year %100! =0)) ||( year%400==0))
system.out.print In("specified year is leap year");
else
system.out.print In("specified year is not a leap year");
}
}
output-:
enter the year: :
2020
specified year is leap year
Similar questions