arrow
arrow
arrow
Which of the following options is a correctly formatted variable name in most programming languages?
Question



Which of the following options is a correctly formatted variable name in most programming languages?

A.

123abc

B.

abc!123

C.

abc_123

D.

abc-123

E.

abc 123

Correct option is C

abc_123 is a correctly formatted variable name in most programming languages. It follows common naming rules, such as starting with a letter and using an underscore, which is generally allowed.
Important Key Points:
1. Variable names in most programming languages must start with a letter or an underscore.
2. Underscores (_) are often allowed in variable names to improve readability.
3. Numbers can be used in variable names, but they cannot be at the beginning.
Knowledge Booster:
· 123abc: This is not allowed as a variable name because it starts with a number, which violates most naming rules.
· abc!123: The character ! is not allowed in variable names in most languages because it is a special symbol often used for logical operations.
· abc-123: The character - is not permitted in variable names since it is interpreted as the subtraction operator in programming.
· abc 123: Spaces are not allowed in variable names, as they create ambiguity. Instead, underscores (_) are commonly used for separation in variable names.

Free Tests

Free
Must Attempt
Video Solutions

RBI Assistant Pre 2026 Full Mock Test -01

languageIcon English
  • pdpQsnIcon100 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Asst Prelims 2026 : Reasoning Section Test 01

languageIcon English
  • pdpQsnIcon35 Questions
  • pdpsheetsIcon35 Marks
  • timerIcon20 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Office Attendant 2026 Full Mock Test - 01

languageIcon English
  • pdpQsnIcon120 Questions
  • pdpsheetsIcon120 Marks
  • timerIcon90 Mins
languageIcon English
test-prime-package

Access ‘IBPS SO IT Officer’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
354k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow