Oh sorry I read the -- one as error thrown. Well regarding what they do, in this particular case with num = 0 initially, the condition never becomes true and the code inside the if statement never executes. Why ? Because its post-increment and post-decrement, which means the value is only incremented in the next line of code after increment is used. Which means inside the condition check num will be still 0 and after the condition check num will become 1 or -1 respectively.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Oh sorry I read the -- one as error thrown. Well regarding what they do, in this particular case with num = 0 initially, the condition never becomes true and the code inside the if statement never executes. Why ? Because its post-increment and post-decrement, which means the value is only incremented in the next line of code after increment is used. Which means inside the condition check num will be still 0 and after the condition check num will become 1 or -1 respectively.