Which of the following is not a valid variable name in most programming languages?

Options

  • A. myVariable
  • B. 123Variable
  • C. _myVariable
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. 123Variable

Detailed Explanation

Correct Answer: B — 123Variable.

Explanation: In languages such as C, C++, Java and Python, an identifier cannot begin with a digit. It may begin with a letter or an underscore. Therefore, myVariable and _myVariable are valid identifiers in these languages.