0
Explain the output.
4 Answers
+ 2
you have decleared variable x =5 in cout statement you incrementing value you have yse ++ two times and remember that alway expression solve from left to right . amd in alway first pre incremt or pre decrement will solve and assign then post . so first x++ will print 5 then value increase by 1 then second x++ here thus incremented value will print means 6 but here you have written x++ again and it will print 6 then value increased by 1 means 7 which is not using anywhere in program thats why it showing warning becz you not using 7 anywhere so try to avoid such types of calculation to your program becz it generate warnings and also its depend on compiler how it solve
+ 1
Kumar Anshuman
int x = 5;
int y = x++; //first assign then increment by 1
cout << y; //5
cout << x; //6
0
I also wrote this code on GeeksforGeeks compiler and there it shows 65 as the output without any warning.
But here it shows 56 with a warning.
Why?
Please explain.
0
Please explain this
https://ide.geeksforgeeks.org/6e61fac7-2a68-4ada-a6a7-a75a1a1854ec