Problem

In this exercise, you learn two ways to stop a program that is in an endless (infinite)...

In this exercise, you learn two ways to stop a program that is in an endless (infinite) loop.

a. Follow the instructions for starting C++ and viewing the TryThis19.cpp file, which is contained in either the Cpp7\Chap07\TryThis19 Project folder or the Cpp7\Chap07 folder. (You may need to open the project/solution file first.) If necessary, delete the two forward slashes that appear before the system("pause"); statement, and then save the program.

b. Run the program. You can tell that the program is in an endless loop because it displays the number 0 over and over again in the Command Prompt window. In most cases, you can stop an endless loop by pressing Ctrl+c (press and hold down the Ctrl key as you tap the letter c, and then release both keys). Use the Ctrl+c key combination to stop the program. If necessary, close the Command Prompt window.

c. Run the program again. You also can use the Command Prompt window’s Close button to stop an endless loop. Click the Command Prompt window’s Close button.

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search