Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Difference between plastic variables ab and c
Difference between plastic variables ab and c
The value of a is 4, and the value of b is 3.

Code explanation: first, define integer variables A, B and C, assign initial value 3 to A and initial value 5 to B; Then, assign c to (a >;; The value of -b), the value of a is 3, and the value of b after -b operation is 4, so (a >;; -b) is false, and its value is 0, so the value of c is 0; Then carry out a++ operation, and add 1 to A to get 4; B operation, b MINUS 1 to get 3. Therefore, the value of a is 4 and the value of b is 3.

If the last piece of code is c =(a>;; - b)? a++:B-; Then, because (a & gt-b) is false, the value of B is given to C first, and the value of C is 4, and then the value of B is 3, while the value of A remains unchanged. At this time, the value of a is 3, and the value of b is 3.

Please forgive me if there is any mistake.