+ 2

What will be the output and how it will be?

#include <iostream> using namespace std; int main() { int x,y,z; x=10; y=15; z=x+++y; cout<<x<<endl; cout<<y<<endl; cout<<z; return 0; }

3rd Oct 2017, 7:48 AM
Saii Jeelakarra
Saii Jeelakarra - avatar
3 Answers
+ 16
#include <iostream> using namespace std; int main() { int x,y,z; x=10; y=15; z=x+++y; // x = 11, y = 15, z = 11 + 15 = 25 cout<<x<<endl; // 11 cout<<y<<endl; // 15 cout<<z; // 25 return 0; } Output: 11 15 25
3rd Oct 2017, 8:03 AM
Babak
Babak - avatar
+ 4
Copy paste it in a compiler and you will know. Even SoloLearn has one
3rd Oct 2017, 7:53 AM
Dapper Mink
Dapper Mink - avatar
+ 1
z=x+y.. then add 1 to x so x=11, y=15, z=10+15=25
3rd Oct 2017, 8:14 AM
Dina
Dina - avatar