116k views
2 votes
Which of the following variable names is not valid? 1price 1 price price 1 price1

User Rasik
by
4.8k points

1 Answer

2 votes

Answer:

1price 1 price price 1

Step-by-step explanation:

In the c programming, the rule for valid variable name.

1. Variable name cannot start with numeric value like 1,2,3..

2. Space and special character other than underscore '_' are not allowed.

3. After the first letter, numeric values can be used.

Let discuss the options:

Option A: 1price

it start with number which is not allowed.

Option B: 1 price

it start with number and also contain the space which is not allowed.

Option C: price 1

it contain the space which is not allowed.

Option D: price1

it is the valid variable name, start with letter and their is no space.

Therefore, option A, B and C are correct option.

User Ccxvii
by
4.5k points