0

Different outputs !?

https://code.sololearn.com/cNK7O88bC545/?ref=app I ran this C language code first on turbo C++ 3.1 and then on Sololearn's Code Playground.. in the first case the output was 18 and then here it was 19. I am in a fix. Help !

12th Nov 2019, 6:53 AM
piyush satpathy
piyush satpathy - avatar
3 Respuestas
0
I am a beginner.. so.. I just want to understand.. why is there difference between outputs on my laptop using turbo c++ 3.1 and on my phone using sololearn's code playground. The code I typed in both places are exactly the same.. I checked.
12th Nov 2019, 7:10 AM
piyush satpathy
piyush satpathy - avatar
0
Since the first one gives 18 and the second one gives 19.. my teacher also prefers the turbo c++ 3.1 answer.. that is 18.. but I used the rules of postfix and prefix increment and decrement operators and got 19.. So which one is actually correct ?
12th Nov 2019, 7:18 AM
piyush satpathy
piyush satpathy - avatar