0

Can someone explain this output for me?

Why does it sort of revert? https://code.sololearn.com/ciXKCOW9GHUP/?ref=app

16th Nov 2019, 10:00 AM
fataMorgana
fataMorgana - avatar
3 Respostas
+ 3
Compiler starts program execution form right to left. So, a=10 First a++ (post increment) set the a to 10 Second ++a(pre increment) set the value to 12 because previous 'a' is also increment by 1 now it's again incrementing by 1 which makes 'a' incremented by 2 Third now our a is 12 so it print 12 Output, 12 12 10
16th Nov 2019, 10:10 AM
Chirag Kumar
Chirag Kumar - avatar
0
Cool. Thanks👍
16th Nov 2019, 10:41 AM
fataMorgana
fataMorgana - avatar