I just want to loop this program with the user entering "yes". I figured I would use a do/while loop around the whole program but nothing happens. Here is my code:
public static void main(String[] args) {
int num1, i;
Scanner Scan = new Scanner(System.in);
do {
do {
System.out.print("Enter a number between 20 and 30 ---> ");
num1 = Scan.nextInt();
} while (num1 > 30 || num1 < 20);
for (i = num1; i >= 20; i--) {
System.out.print(i + " ");
}
System.out.println("");
} while (Scan.equals("yes"));
}
YESafter showing him the list of numbers, soScanstill contains the number he input.