+ 2
What is the difference between ++i and i++?
i++ = first assign then increment //postfix increment ++I = first increment then assign //prefix increment Example - //postfix increment i= 4; i++; Printf("%d",i); //prefix increment i= 4; ++i; Printf("%d",i); GUESS THE OUTPUT 😌
2 odpowiedzi
+ 1
Well, the output would be an error. You forgot the semicolons and to declair i and c is case sinsitive.
If you fix all those errors, the output for each is 5
https://code.sololearn.com/c8h2mc0PpwJ1/?ref=app
The difference would be if you had:
printf("%d\n",i++);
And:
printf("%d",++i);
https://code.sololearn.com/cVTHIi06E3F2/?ref=app
+ 1
Updated the code 💙! Thanks