Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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(temp) + 2); //Line 4 cout << "The value of found is: " << found << endl; //Line 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The World Wide Web And Databases International Workshop Webdb 98 Valencia Spain March 27 28 1998 Selected Papers Lncs 1590

Authors: Paolo Atzeni ,Alberto Mendelzon ,Giansalvatore Mecca

1st Edition

3540658904, 978-3540658900

More Books

Students also viewed these Databases questions