I think of a C language question answered by Baidu last semester, as shown below:
------------------------------------
# Include "stdio. H "Main () {int A = 1, B = 2, c = 3, T; while (A <B <c) {T = A; A = B; B = T; c --;} printf ("% d, % d, % d", a, B, c );}
What is the answer? Why? The answer is not 2 1 2
-------------------------------------
This is my answer.
The answer should be 121. The problem lies in the loop condition of while (). In fact, this loop is executed twice, in parentheses, the actual judgment process of a> B> C is to first judge whether A> B is true. If it is true, 1 is returned, that is, (A> B) is changed to 1, then compare it with C. If it is false, 0 is returned. That is to say, after comparing a and B, (A> B) is changed to a specific value (1 or 0) and C. According to this principle,ProgramIt repeats twice. If the brackets contain while (A <B & B <C), the program runs once and the answer is 212.