Self-Review Exercises

  1. 2.1 Fill in the blanks in each of the following.

    1. Every C++ program begins execution at the function           .

    2. A(n)            begins the body of every function and a(n)            ends the body.

    3. Most C++ statements end with a(n)           .

    4. The escape sequence \n represents the            character, which causes the cursor to position to the beginning of the next line on the screen.

    5. The            statement is used to make decisions.

  2. 2.2 State whether each of the following is true or false. If false, explain why. Assume the statement using std::cout; is used.

    1. Comments cause the computer to print the text after the // on the screen when the program is executed.

    2. The escape sequence \n, when output with cout and ...

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.