13. Evaluate the following expressions, if the values of the variables are: a = 2, b = 3 and c = 3 i. a - (b++) * (--C) ii. a * (+ +b) %C
Answers
Answered by
4
a = 2
b = 3
c = 3
i. a - b++ * -- c
ii. a * ++b % c
i. -4
ii. 2
Difference between postfix and prefix form of increment.
- Postfix form uses the variable first and then increments it.
- While prefix form first increments it and then works over it
var a = 5;
console.log(a++); // Outputs 5
var a = 5;
console.log(++a); // Outputs 6
I hope that I did not make any mistakes. Sorry for the inconvenience, if any.
Hope this helps...
Similar questions