Which symbol can be used in variable name?

By Anjnee Bhatnagar|Updated : July 8th, 2022

Which symbol can be used in variable name?

  1. * (asterisk)
  2. | (pipeline)
  3. – (hyphen)
  4. _ (underscore)

Answer: D. _ (underscore)

Underscore ( _ ) symbol can be used in variable name.

Solution

In C programming, a variable name can consist of a combination of letters both in lower case and upper case, digits, or integer numbers, and only one special symbol underscore (_). A variable name may begin with a letter or an underscore. Other than underscore(_), no other special symbol can be used in a variable name.

Looking at the options, we can clearly eliminate A, B, and C. So the correct choice is option D.

☛ Related Questions:

Comments

write a comment

Follow us for latest updates