While and do-While Loop Review


Exercise: What does the following do-while loop display? 

int number = 142391;
do {
    int digit = number % 10;
    System.out.println(digit);
    number = number / 10;
} while (number != 0);




Exercise: Write a program that prompts the user to enter a sequence of (integer) exam scores. The user enters a negative number to quit. Then print the high and low scores.