30.6k views
4 votes
Which one of the following represents a valid Variable name?

a. 2A

b. $2

c. d+4

d. d 4

1 Answer

2 votes

Answer:

b. $2

Step-by-step explanation:

a. 2A is not a valid variable because variable names cannot begin with a number.

b. $2 is valid because variable names can begin with $ or _ characters.

c. d+4 is not a valid variable because variable names can only contain letters, numbers, underscores, or dollar signs. (+) sign is invalid.

d. d 4 is not a valid variable because variable names cannot contain spaces.

User Anil Purswani
by
5.8k points