Skip to main content

Section 2.30 Expressions-WE10-P1

Subgoals for evaluating an assignment statement.

  1. Determine resultant data type of expression
  2. Update variable for pre operators based on side effect
  3. Solve arithmetic equation, operator precedence
  4. Is the Left Hand Side (LHS) of the assignment statement a variable? Check the data type of the value on right hand side (RHS) against data type of LHS variable.
  5. Update variable for post operators based on side effect

Subsection 2.30.1

Given
int x,y,z;
int x = 42;
int y = 11;
int z = 5;
x = z;
y = x;
z = y;

Exercises Exercises

1.
Q75: What is the final value of x?
2.
Q76: What is the final value of y?
3.
Q77: What is the final value of z?
You have attempted of activities on this page.