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;
#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
Comments
Leave a comment