hamburger

Which symbol can be used in variable name?

By BYJU'S Exam Prep

Updated on: September 25th, 2023

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:

Our Apps Playstore
POPULAR EXAMS
SSC and Bank
Other Exams
GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com
Home Practice Test Series Premium