Update variable for pre operators based on side effect
Solve arithmetic equation, operator precedence
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.
Update variable for post operators based on side effect
ExercisesExercises
1.
Q1: Given the following, what value is stored in variable alpha?
int alpha = 0;
int x = 5;
int y = 6;
int z = 2;
alpha = x + y * z - 1;
2.
Q2: Given the following, what value is stored in variable beta?
int beta = 0;
int x = 5;
int y = 6;
int z = 2;
beta = (y + 3) * (x / 3) - z;
3.
Q3: Given the following, what value is stored in variable gamma?
int x = 5;
int y = 6;
double gamma = 1.0;
4.
Q4: Given the following, what value is stored in variable delta?
int delta = 0;
int x = 5;
int y = 6;
int z = 2;
delta = x % y * z % y;
5.
Q5: Given the following, do iota and zeta contain the same value?
int eta = 5;
int iota = (eta + 5) * (5 % eta + 2);
int zeta = eta + 5 * (5 % eta + 2);