0
What does it mean when the parenthesis after the word "while" contains only a single variable?
You may refer the attached code. https://code.sololearn.com/cZ28BZ3DDb7j/?ref=app
6 Respuestas
+ 3
Because int x has the truth value true, if x is not 0, and false, if x ==0, you can use an int as a condition.
+ 1
Is that means all statements within the while block will be executed only if the values assigned to the variable x is non-zero?
+ 1
Yes
+ 1
But if x ==2, it is not equal to true but it evaluates to true. https://stackoverflow.com/questions/5189072/c-bool-question
0
Understood. Thank you!
0
Alright 👍