Which of the following is NOT a correct variable name? *
2bad
Zero
theLastValueButOne
Year2000
Answers
Explanation:
Which of the following is not a valid variable name declaration? Explanation: Variable name cannot start with a digit. 5. Why do variable names beginning with the underscore is not encouraged?
Answer:
The incorrect variable name out of all the given options is found to be: 2bad.
Explanation:
All of the programming languages have some rules defined for naming the variables used in the respective languages.
It is a common rule as well as a useful practice to always start the names of the variables with a letter and not with any number or a special symbol. Variable names can include a number later in the name but should not have any special characters.
The given options for variable names are as follows:
2bad
Zero
theLastValueButOne
Year2000
Out of the given options only one starts with an integer which is not allowed, the rest of the options are following the rules.
Thus, the name '2bad' is the incorrect choice for a variable name.