In C++, What is the value of x when the above code is done executing? Assume there are no syntax errors and the code will compile.
int x;
int y;
cin >> x;
cin >> y;
while (x > y)
{
x -= 3;
cout << x << " ";
}
cout << endl;
What is the value of y when the above code is done executing? Assume there are no syntax errors and the code will compile.
int x;
int y;
cin >> x;
cin >> y;
while (x > y)
{
x -= 3;
cout << x << " ";
}
cout << endl;
Answer)
The value of x when the above code is done executing is:
int x;
int y;
cin >> x;
cin >> y;
while (x > y)
{
x -= 3;
cout << " ";
}
cout << endl;
Input:
2
1
Output:
Value of x is = -1
The value of y when the above code is done executing is:
int x;
int y;
cin >> x;
cin >> y;
while (x > y)
{
x -= 3;
cout << x << " ";
}
cout << endl;
Input:
2
1
Output:
Value is y is = 1
In C++, What is the value of x when the above code is done executing? Assume...