Question: 10. Consider the following section of C++ code: #include stdafx.h #include using namespace std; int main() { int m = 3, n = 2, x
10. Consider the following section of C++ code:
#include stdafx.h #include using namespace std; int main()
{
int m = 3, n = 2, x , y;//Variable declarations and initializations
x = m + 5;
m--;
y = (m + 4)/3;
n = (n--) + 2; m = m +
n/2; m++;
x = (--x) * 2 - 3; y = y *
2;
n = n + y * 3;
cout << "m = " << m << endl; // Statement -1 for output printing cout << "n = " << n << endl; // Statement -2 for output printing cout << "x = " << x << endl; // Statement -3 for output printing cout << "y = " << y << endl; // Statement -4 for output printing return 0;
}
What will be the value of variables m, n, x and y as printed in the statement -1, statement -2, statement -3 and statement -4?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
