0

Can anyone try to explain me how the ans is coming 65??

https://code.sololearn.com/cz917fkgeyCf/?ref=app

15th Mar 2019, 7:50 AM
Abhishek Yadav
Abhishek Yadav - avatar
3 Answers
+ 2
x will be expanded by preprocessor with 10+5 then int a= x*x is same like int a= 10+5*10+5 and because multiplication have precedence over addition, a will be 10+(5*10)+5==10+50+5= 65
15th Mar 2019, 8:10 AM
KrOW
KrOW - avatar
0
I thought x will be 15 Thanks KrOW
15th Mar 2019, 8:16 AM
Abhishek Yadav
Abhishek Yadav - avatar
0
You can check also the thread : https://www.sololearn.com/Discuss/1716100/why-this-code-outputs-9-7-but-not-9-16 for more examples ...
15th Mar 2019, 8:30 AM
Prokopios Poulimenos
Prokopios Poulimenos - avatar