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 a = 0;
int b = 1;
int c = 2;
int d = 3;
int alpha;
alpha = ++a + b--;
2.
Q2: Given the following, what value is stored in variable beta?
int a = 0;
int b = 1;
int c = 2;
int d = 3;
int alpha;
int beta;
alpha = c-- * ++b;
beta = alpha - d++ + b * a;
3.
Q3: Given the following, what value is stored in variable gamma?
int a = 0;
int b = 1;
int c = 2;
int gamma;
gamma = ++a + ++b + c--;
4.
Q4: Given the following, what value is stored in variable delta?
int a = 0;
int b = 1;
int c = 2;
int d = 3;
int delta;
delta = d / --c - a % ++b;
3
2
1
0
5.
Q5: Which of the following are syntactically valid ways to increment the value of eta by one? Select all that apply.