+ 1

Resultado? Desglosar

Int a=2, b, c; b=++a; c=++a; a= b * c; Cout << a;

10th Jan 2019, 6:35 AM
Jeremias De la Cruz
2 Answers
+ 2
You can try such things easily in the Code Playground. Also print intermediate steps for more insight. Since prefix ++a is used, you will increase a, THEN assign it to b, which will be 3. In the next line a is increased again, then assigned, so c is 4. Therefore b*c is 12, which is written on a and printed.
10th Jan 2019, 6:45 AM
Matthias
Matthias - avatar
0
And replace line 3 by c = ++b What is result?
10th Jan 2019, 6:53 AM
Jeremias De la Cruz