What will be displayed by the following statement? (Hint: Indent the statement correctly first.) int x = 1, y = -1, z = 1; if (x> 0) if (y > 0) cout <« "x>0 and y> 0" << endl; else if (z> 0) A. x>0 and y> 0; B. x<0 and z> 0; C. x<0 and z<0; D. nothing will be displayed. cout << "x<0 and z> 0"« endl;

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 7SA: Consider the following statements: Which of the following statements are valid? If they are...
icon
Related questions
icon
Concept explainers
Question

17  please quickly  thanks !

 

What will be displayed by the following statement? (Hint: Indent the statement correctly first.)
int x = 1, y = -1, z = 1;
if (x > 0)
if (y > 0)
cout << "x> 0 and y > 0" << endl;
else if (z> 0)
cout << "x <0 and z> 0" < endl;
A. x>0 and y > 0;
B. x<0 and z> 0;
C. x<0 and z<0;
D. nothing will be displayed.
Transcribed Image Text:What will be displayed by the following statement? (Hint: Indent the statement correctly first.) int x = 1, y = -1, z = 1; if (x > 0) if (y > 0) cout << "x> 0 and y > 0" << endl; else if (z> 0) cout << "x <0 and z> 0" < endl; A. x>0 and y > 0; B. x<0 and z> 0; C. x<0 and z<0; D. nothing will be displayed.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT