guess the value of each of the following and explain your logic.
int x=5;
cout<< x++ + ++x<<endl;
x=5;
cout<< ++x + x++<<endl;
x=5;
cout<<++x + ++x<<endl;
x=5;
cout<<++x + ++x + ++x<<endl;
c++ is amazing
guess the value of each of the following and explain your logic.
int x=5;
cout<< x++ + ++x<<endl;
x=5;
cout<< ++x + x++<<endl;
x=5;
cout<<++x + ++x<<endl;
x=5;
cout<<++x + ++x + ++x<<endl;
| Rev. | Язык | Кто | Когда | Δ | Комментарий | |
|---|---|---|---|---|---|---|
| en3 |
|
virgil_van_maguire | 2025-01-06 14:29:07 | 41 | ||
| en2 |
|
virgil_van_maguire | 2025-01-06 14:15:28 | 44 | Tiny change: 'x<<endl;\n' -> 'x<<endl;\n x=5;\n cout<<++x + ++x + ++x<<endl;\n' | |
| en1 |
|
virgil_van_maguire | 2025-01-06 14:12:58 | 218 | Initial revision (published) |