Please someone explain me the output. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Please someone explain me the output.

int a =1 ; int b = ((++a) * (++a) * (++a)); cout <<b ; output is :- 36 .. How ??????

12th Sep 2016, 6:34 AM
MAZHAR IMAM KHAN
MAZHAR IMAM KHAN - avatar
2 Answers
+ 4
So, look. prefix plus 1 and chande the last variable by plus 1 too, ok? and how does it solute: (++a)*(++a)*(++a)=(++1)*(++1)*(++1)= =(2)*(++2)*(++2)= =(3)*(3)*(++3)= =(3)*(3)*(4)= 36
12th Sep 2016, 6:50 AM
Dimash Sabit
Dimash Sabit - avatar
+ 1
Thanks a lot my friend . You gave an excellent explanation. @ dimash sabit
12th Sep 2016, 6:53 AM
MAZHAR IMAM KHAN
MAZHAR IMAM KHAN - avatar