?
A C variable cannot start with
Answer & Solution
Correct Answer:
Option
C
In C programming, variable names must adhere to specific rules regarding their initial characters. A C variable cannot start with the following:
A Number:
Variable names in C must begin with a letter (a-z, A-Z) or an underscore (_). They cannot start with a digit (0-9). For example, 1variable is not a valid variable name.
A Special Symbol Other Than Underscore:
Variable names cannot start with special symbols like @, #, $, etc., other than the underscore (_). For example, @variable is not a valid variable name.
Option D: An Alphabet:
This option is incorrect because variables can start with an alphabet (a-z, A-Z) or an underscore (_).
Therefore, the correct answer is Option C: Both of the above as variable names cannot start with a number or a special symbol other than an underscore.
A Number:
Variable names in C must begin with a letter (a-z, A-Z) or an underscore (_). They cannot start with a digit (0-9). For example, 1variable is not a valid variable name.
A Special Symbol Other Than Underscore:
Variable names cannot start with special symbols like @, #, $, etc., other than the underscore (_). For example, @variable is not a valid variable name.
Option D: An Alphabet:
This option is incorrect because variables can start with an alphabet (a-z, A-Z) or an underscore (_).
Therefore, the correct answer is Option C: Both of the above as variable names cannot start with a number or a special symbol other than an underscore.
Join the Discussion
Login to post a comment or share your explanation.
Login