The unary operator ++
first returns the value of the operand, then increments the value of the operand. The value of num1
is 10
, since the increaseNumber
function first returns the value of num
, which is 10
, and only increments the value of num
afterwards.
num2
is 10
, since we passed num1
to the increasePassedNumber
. number
is equal to 10
(the value of num1
). Again, the unary operator ++
first returns the value of the operand, then increments the value of the operand. The value of number
is 10
, so num2
is equal to 10
.