Answer to Question #285282 in C++ for Asawer

Question #285282

What is the output of the following C++ code?

x = 100;

y = 200;

if (x > 100 && y <= 200)

cout << x << " " << y << " " << x + y << endl;

else

cout << x << " " << y << " " << 2 * x - y << endl;


1
Expert's answer
2022-01-07T01:49:41-0500
#include <iostream>
using namespace std;
int main() {
    int x = 100;

    int y = 200;

    if (x > 100 && y <= 200){

        cout << x << " " << y << " " << x + y << endl;
    }
    else {

        cout << x << " " << y << " " << 2 * x - y << endl;
        
    }
}


100 200 0

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