Please someone explain me the output. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antworten
+ 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