2(ii)
Evaluate the given expression when the value of a=2 and b=3
b*=a++ - ++b + ++a;
System.out.println("a= "+a);
System.out.println("b= "+b);Show SolutionHide Solution↓
a = 4, b = 6
Explanation:
The given expression is evaluated as follows:
b*=a++ - ++b + ++a
b = b * (a++ - ++b + ++a) [a=2, b=3]
b = 3 * (2 - 4 + 4) [a=4, b=4]
b = 3 * 2
b = 6