Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started