Answer to Question #339106 in C++ for alemante teju

Question #339106

What is the output of each of the following statements? Assume that

x = 5, y = 2, z = 10, and temp = 0

 

6. if (x + y > z)

      x = y + z;

   else

      x = y - z;

   cout<< x << " " << y << " " << z << endl;


1
Expert's answer
2022-05-09T14:54:25-0400
#include <iostream>


using namespace std;


int main(){
	int x = 5, y = 2, z = 10, temp = 0;
	
	if (x + y > z)
	   x = y + z;
	else
		x = y - z;
	cout<< x << " " << y << " " << z << endl;
	return 0;
}

ANSWER:

Output:

-8 2 10

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS