class Addition { public static void main(String s[]) { int a = 4; a++; a += a; --a; a = 7 + a; a *= a; a -= 3;
System.out.println(" a = " + a ); } }
Program does not compile
a = 255
a = 253
a = 286
Correct Answer : C
Execution of program starts from main. Inside main an integer variable a is declared and initialized to 4. a++ increments a to 5. This new value is reflected when a is used next time.
a += a -> a = a + a -> a = 5 + 5 = 10 --a decrements a to 9. a = 7 + a = 7 + 9 = 16 a *= a -> a = a * a = 16 * 16 = 256 a -= 3 -> a = a - 3 = 256 - 3 = 253
The value of a is printed using the display statement. So output is a = 253.