1. In all problems below, please assume the following variables have been initia
ID: 2997301 • Letter: 1
Question
1. In all problems below, please assume the following variables have been initialized:
int A = 3; int B = -2; int C = 2;
int R = -4, int S = -4; int T = 1;
What is the expected output for each of the following stubs of code? (12 points)
OUTPUT
A. if (A <= 0)
{
A = 2 * A;
}
cout << A << endl; __________
B. if (R <= 0)
{
R = 2 * R;
}
cout << R << endl; __________
C. if (B < (C
Explanation / Answer
A. 3
B. -8
C. 2
D. C is less than A
A is less than C (This line will be in the output in any case)
E. The value of A is 7
F. The value of A is 1
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.