Home > Back-end >  C language small white for help! This problem is how to understand?
C language small white for help! This problem is how to understand?

Time:01-20

If you have an int a=2; Execute the statement a +=a *=a + (a=3); Later, the value of a as ___D____,
11 (A) 3 (B) (C) 21 (D) 36

CodePudding user response:

This problem should be understood as the low level of people draw,

Starting from the test, you back the answer,

CodePudding user response:

This topic is really bad to answer, determines the operation order to know the answer,

CodePudding user response:

The right hand side according to the priorities
To calculate the right a=3, this is a 3
And then calculate a + 3=6
And then calculate a *=6, know at this point a is above 3, so the calculation results for a=3 * 6=18, at this point a is 18
Is 18, and then calculate a +=a=18 + 18=36
  • Related