How is this possible? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

How is this possible?

https://www.sololearn.com/post/1049609/?ref=app In this It says the answer is 30 isn't it 25? Please explain

22nd Apr 2021, 8:18 AM
K.S.S. Karunarathne
K.S.S. Karunarathne - avatar
6 Réponses
+ 1
Yes
22nd Apr 2021, 8:50 AM
Atul [Inactive]
+ 1
That means the increment operator works first befor doing multiplication and division .
22nd Apr 2021, 8:51 AM
K.S.S. Karunarathne
K.S.S. Karunarathne - avatar
0
5*foo++=6 Thereby 5*6=30
22nd Apr 2021, 8:47 AM
Atul [Inactive]
0
So it adds one before multiplying it right ?
22nd Apr 2021, 8:49 AM
K.S.S. Karunarathne
K.S.S. Karunarathne - avatar
0
No I mean that 5*(5+1)=5*6=30. Like this
22nd Apr 2021, 8:52 AM
Atul [Inactive]
0
Okay thanks
22nd Apr 2021, 8:53 AM
K.S.S. Karunarathne
K.S.S. Karunarathne - avatar