(xvii) A student executes the following code to increase the value of a variable 'x' by 2.
He has written the following statement, which is incorrect.
x=+2;
What will be the correct statement?
A. x+=2;
B. x=2;
C. x=x+2;
(a) Only A
(b) Only C
(c) All the three
(d) Both A and C
Solution
(d) Both A and C