62.5k views
4 votes
The following are all invalid variable names: 3g, 87, 67h2, h22, and 2h.

a) True
b) False

User Dancreek
by
7.7k points

1 Answer

5 votes

Final answer:

The statement is mostly true; variable names cannot start with a digit, which makes 3g, 87, 67h2, and 2h invalid, but h22 is a valid variable name.

Step-by-step explanation:

The statement that the following are all invalid variable names: 3g, 87, 67h2, h22, and 2h is true. In many programming languages, variable names cannot begin with a digit. The names 3g, 87, and 2h start with numbers, which is not allowed, therefore these are invalid. The name 67h2 also begins with digits, making it invalid.

However, h22 is a valid variable name because it starts with a letter. As per the question instructions, only the statement should be corrected which is: The following are mostly invalid variable names, with the exception of h22.

User Nupanick
by
8.2k points