Using a Counter-Controlled while Loop
In this exercise, you use what you have learned about counter-controlled loops. Study the following code, and then answer Questions 1-4.
1. What is the value of number1 when the loop exits? _____________________________________________________________________________________
2. What is the value of number2 when the loop exits? _____________________________________________________________________________________
3. If the statement number1++ is changed to ++number1, what is the value of number1 when the loop exits? _____________________________________________________________________________________
4. What could you do to force the value of number2 to be 21 when the loop exits? _____________________________________________________________________________________
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.