Question: for some reason if i enter a year less than 1800 or greater than 2018 it still skips the while loop please help why? int

for some reason if i enter a year less than 1800 or greater than 2018 it still skips the while loop please help why?

int year = sc.nextInt(); while (year < 1800 && year > 2018) { System.out.println("Please input a proper year."); year = sc.nextInt(); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!