ij-macro-programming-workshop

Previous            Solution            Next

Exercise 05.03 - Variables and pre- and post increment

Aim:

The pre-increment ++a incements the value of a before the expression containing a is evaluated, the post-increment a++ first increments a and then evaluates the containing expression.

Look at the code below. What will be the values of a, b, c and d? Print the values of a, b, c and d to verify your answer.


a = 5;
b = a++ + 3;
c = 5;
d = ++c + 3;

Your code starts after this line



Your code ends before this line

Previous            Solution            Next