Important MCQ

Which is an INVALID variable name?

Q.Which is an INVALID variable name?

A) Total
B) total-2
C) _total
D) total2
Correct Answer:
Option B
Detailed Explanation:
B) total-2 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.