can someone tell me what the condition is to exit the loop? Is it while x-1 not equal to 0?Code:while ((x-1)) { ++counter; x--; }
can someone tell me what the condition is to exit the loop? Is it while x-1 not equal to 0?Code:while ((x-1)) { ++counter; x--; }
Did you get a chance to test it in the 30 minutes waiting for a reply?
And yes is the answer.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Yes i did test it but getting a result and watching watchers doesn't necessarily explain the lines definition...