Home > Back-end >  While in the program (x -) can also be linked to true or false? Not only the relational operators an
While in the program (x -) can also be linked to true or false? Not only the relational operators an

Time:01-28

# include "stdio.h"
The main ()
{
Int x=2;
While (x -)//x - here and judging true or false?
;
Printf (" % d ", x);
}

CodePudding user response:

Non-zero is true, 0 for false

CodePudding user response:

I seem to understand, while statement (expression), expression=1 is true, continue to cycle; Expression=0 is false, jump out of the loop, so the final output is x=1.

CodePudding user response:

C language, nonzero to true, zero to false
  • Related