Answers to Self-Review Exercises
-
main
.left brace (
{
), right brace (}
).semicolon.
newline.
if
.
-
False. Comments do not cause any action to be performed when the program is executed. They’re used to document programs and improve their readability.
True.
True.
True.
False. C++ is case sensitive, so these variables are different.
True.
True.
False. The operators
*
,/
and%
have the same precedence, and the operators+
and-
have a lower precedence.False. One statement with
cout
and multiple\n
escape sequences can print several lines.
-
int c{0}, thisIsAVariable{0}, q76354{0}, number{0};
std::cout << "Enter an integer: "
;std::cin >> age;
if (number != 7) { std::cout << "The variable number is not equal to 7\n"; }
std::cout ...
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.