#include
int main()
{
int x = 0;
if (x++)
printf(\"true\\n\");
else if (x == 1)
printf(
0
is equivalent to false in C. As you are using post-increment operator, condition is evaluated before increment so x is false and printf("true\n");
is never executed. Then goes to else
and succeeds evaluating x == 1
, then prints false.
As a good practice, try to avoid assignations in condition sentences.