Important MCQ

After int a = 4; a = a + 2; the value of a is

Q.After int a = 4; a = a + 2; the value of a is

A) 4
B) 42
C) 6
D) 2
Correct Answer:
Option C
Detailed Explanation:
C) 6 is correct. A variable is a named memory location. Declare it with a data type before use; names cannot start with a digit or be keywords, and = assigns a value.