193 post karma · 3,648 comment karma · joined Mar 2020
You have to read the number on every iteration. Just place the following lines after the do and before the if and remove the break from the else statement.
System.out.print("Enter an integer between 1-10 : ");
int number = input.nextInt();
You have to read the number on every iteration. Just place the following lines after the do and before the if and remove the break from the else statement.
System.out.print("Enter an integer between 1-10 : ");
int number = input.nextInt();