+ 1
EXPLAIN HOW OUTPUT IS 80
int main { int a=2; cout<<++a*++a*++a; return 0; }
8 Antworten
+ 9
well it's output is compiler dependent different compiler give different output
in this possibly the code is do like this
a=2;
cout<<(++a*++a) *++a;
so in parenthesis when value is incremented last incremented value is the value of variable which is 4
cout<<(4*4) *5;
so in parenthesis when value is incremented last incremented value is the value of variable a
first increment a become 3
second increment a become 4
so 4 is the value of a then next time increment then a become 5
after the parenthesis
so expression is make 4*4*5 which is equal to 80
here is a similar thread by which you will found some more information
https://www.sololearn.com/Discuss/1190633/?ref=app
+ 5
oops.
my answer is wrong but it works in the same way
+ 5
wait for some time i will ask it to my expert friend
+ 5
Thanks GAWEN STEASY
+ 2
a is
now ++a(3)*++a(4)*++a(5)
means 3*4*5 which is equal to 80
+ 1
3*4*5=60 raj chatrala
+ 1
how bro
0
Thanks GAWEN STEASY