Question: Question 3 Run the following code and explain, using your own words, what is happening with each variable (w,x,y,z) and what is the difference between
Question 3
Run the following code and explain, using your own words, what is happening with each
variable (w,x,y,z) and what is the difference between ++x and w++ (is there any
influence on the result between prefix or postfix ++ operator?). Provide a snippet of the
output showing the result.
int main()
{
int w = 20, x = 20;
int y = 5, z = 5;
y = y + (++x);
z = z + (w++);
cout << "x=" << x << " and y=" << y << endl;
cout << "w=" << w << " and z=" << z << endl;
system("pause");
return 0;
}
Provide a paragraph that answers question 3.
Provide 4 valid test cases for (w, x, y, z).
| Test # | Valid / Invalid Data | Description of test | Input Value | Actual Output | Test Pass / Fail |
| 1 | Valid |
| W |
| Pass |
| 2 | Valid |
| X |
| Pass |
| 3 | Valid |
| Y |
| Pass |
| 4 | Valid |
| Z |
| Pass |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
