The answer to this question is: 120
I didn't understand what c = 12 was?
A ++ is the first operation in the auto-Increment
++ A is the First Auto-incrementing operation.
For example, B = a ++ and B = ++ a. If a = 10, B is 10 and 11 respectively.
B = a ++ here, assign a value first. In ++, assign a to B, B = 10, a to auto-increment, a = 10 + 1 = 11
C = ++ a here, first ++, In the assignment, a auto-increment, a = 11 + 1, assign a to c, c = 12
D = 10 * a ++ here, it depends on the computing priority... ++ The auto-increment operator has a higher priority than the = value assignment operator... D = 10 * a ++... A ++, the first operation is auto-increment, a * 10 = 120, a auto-increment, a = 13
Int main (int argc, const char * argv [])
{
Int a, d;
A = 10;
D = 10 * (a ++ );
Printf ("a = % d, d = % d \ n", a, d );
D = 10 * a ++;
Printf ("a = % d, d = % d \ n", a, d );
Return 0;
}
Print:
A = 11, d = 100
A = 12, d = 110.
--------------
Int a, d;
A = 10;
D = 10 * (a ++ );
Printf ("a = % d, d = % d \ n", a, d );
Printing: a = 11, d = 100
Int a, d;
A = 10;
D = 10 * a ++;
Printf ("a = % d, d = % d \ n", a, d );
Printing: a = 11, d = 100
Although the printed results are the same, it depends on whether the operation is auto-incrementing first or not.
-----------
# Include <stdio. h>
Int main (int argc, const char * argv [])
{
Int a, d;
A = 10;
D = 10 * (++ );
Printf ("a = % d, d = % d \ n", a, d );
Return 0;
}
Print:
A = 11, d = 110
------------------
Detailed list of operators in C Language
For operators with the same priority, the operation order is determined by the combination direction.
Note :! > Arithmetic Operators> Relational operators >&>||> value assignment operators
-----------
-
Print result ::
--------------