+ 6

Please make me understand how this output came!!!😇😇😇😇

OUTPUT IS 666 But what is the reason behind this output ? https://code.sololearn.com/czJtj2k08Irj/?ref=app

14th Feb 2018, 3:42 PM
Shivam Kumar Sharma
Shivam Kumar Sharma - avatar
14 Answers
+ 21
a very interesting output @ Gordie, thank you for your links 👍😉
14th Feb 2018, 4:34 PM
tooselfish
tooselfish - avatar
+ 7
Remember ++a increment the value by one. So, when the compiler came to 6th line, it first incremented and then, printed "666".
14th Feb 2018, 4:00 PM
777
777 - avatar
+ 5
But at first, it is 'a' only then how 6 came there ?
14th Feb 2018, 4:04 PM
Shivam Kumar Sharma
Shivam Kumar Sharma - avatar
+ 5
Yes, in CodeBlock the output was 566 but in SoloLearn the output is 666
14th Feb 2018, 5:45 PM
Shivam Kumar Sharma
Shivam Kumar Sharma - avatar
+ 4
@Adarsh would you help me ?
14th Feb 2018, 4:17 PM
Shivam Kumar Sharma
Shivam Kumar Sharma - avatar
+ 2
the Devil is in the details.
15th Feb 2018, 10:12 AM
Mark Propper
Mark Propper - avatar
+ 1
No, C is not ugly @Mark_Propper. It's quite interesting
16th Feb 2018, 5:38 PM
Shivam Kumar Sharma
Shivam Kumar Sharma - avatar
0
Where is the Devil ?
15th Feb 2018, 4:24 PM
Shivam Kumar Sharma
Shivam Kumar Sharma - avatar
0
@Shivam You uncovered them. That it seems the program running the code substituted a++ for all instances of a.
15th Feb 2018, 5:20 PM
Mark Propper
Mark Propper - avatar
0
C is ugly.
15th Feb 2018, 5:20 PM
Mark Propper
Mark Propper - avatar