Question
3. What is the output of the following statements? Be precise! I am only interested in the characters printed by cout and whether or not
3. What is the output of the following statements? Be precise! I am only interested in the characters printed by cout and whether or not they are printed on the same line.
a. if ('-' < '+') cout << "+*"; cout << "%%" << endl;
b. if (100 < 2 * 50) cout << "100"; cout << "2 * 50"; cout << endl;
c. if('Z' < 'z') { cout << 'z'; cout << 'Z'; } cout << '.' << endl;
d. string c1 = "C++", c2 = "C--";
if (c1 >= c2) cout << "C++" << endl; cout << "C--" << endl;
e. string name = "Mat";
if (name <= "Tam") cout << "Mat, Tam" << endl; cout << "Tam, Mat" << endl;
f. if (6 == 2 * 4 - 2) cout << 3 * 4 / 6 8 << endl; cout << "*" << endl;
4. What is the output of the following code? Be precise! I am only interested in the characters printed by cout and whether or not they are printed on the same line.
int num = 10; //Line 1 double temp = 4.59; //Line 2 bool found; //Line 3 found = (num == 2 * static_cast
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started