Chapter 2: Problem 23
include
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.
/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
Learning Materials
Features
Discover
Chapter 2: Problem 23
include
These are the key concepts you need to understand to accurately answer the question.
All the tools & learning materials you need for study success - in one app.
Get started for free
What is the output of the following statements? Suppose a and b are int
variables, c is a double variable, and a = 13, b = 5, and c = 17.5.
a. cout << a + b – c << endl;
b. cout << 15 / 2 + c << endl;
c. cout << a / static_cast
Suppose x, y, z, and w are int variables. What value is assigned to each of these variables after the last statement executes? x = 5; z = 3; y = x - z; z = 2 * y + 3; w = x - 2 * y + z; z = w - x; w++;
Write equivalent compound statements if possible. a. x = 2 *x b. x = x + y - 2; c. sum = sum + num; d. z = z *x + 2 *z; e. y = y / (x + 5);
Suppose x, y, and z are int variables and x = 2, y = 5, and z = 6. What is the output of each of the following statements? a. cout << "x = " << x << ", y = " << y << ", z = " << z << endl; b. cout << "x + y = " << x + y << endl; c. cout << "Sum of " << x << " and " << z << " is " << x + z << endl; d. cout << "z / x = " << z / x << endl; e. cout << "2 times " << x << " = " << 2 *x << endl;
Which of the following variable declarations are correct? If a variable declaration is not correct, give the reason(s) and provide the correct variable declaration. n = 12; //Line 1 char letter = ; //Line 2 int one = 5, two; //Line 3 double x, y, z; //Line 4
What do you think about this solution?
We value your feedback to improve our textbook solutions.