What will be printed out as a result of the following code execution?
int temp=0;
int x=temp++;
int y=--temp;
cout<<"x="<<x<<", y="<<y;
Explanation
Postfix increment and decrement operators while applicable to integer types return the value first and only then modify it. Prefix increment and decrement operators - modify the value first and only then then return it.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з C++
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести