- 1
Guys please help me out with this?
int a=1; int b = a++; printf("%d", a); //Output: 2 Why is the output is 2? shouldn't be 1? Please anyone explain! Thanks in advance. here is the codeâ https://code.sololearn.com/cdh7ExcOrs9G/?ref=app
3 Answers
+ 4
because you use here increment operator by this 1 is become 1+1 that's why the output is 2
that is too simple
+ 2
Look at this code and you will understand what you wrote.
https://code.sololearn.com/cQjW1G7kpt8N/?ref=app