- 1

For (int x=1;x<5, x++){cout<<x;}

Whats is the output? And if the increment bcome ++x what is the new output? Help please for a better understanding

21st Jan 2019, 1:40 AM
Irfan Sukri
Irfan Sukri - avatar
3 Antworten
21st Jan 2019, 1:59 AM
Denise Roßberg
Denise Roßberg - avatar
+ 6
Once again, Code Playground has the answer.
21st Jan 2019, 1:44 AM
Diego
Diego - avatar
+ 1
Prefix: increments the value, and then proceeds with the expression. Postfix: evaluates the expression and then performs the incrementing.
21st Jan 2019, 1:57 AM
Denise Roßberg
Denise Roßberg - avatar