Skip to content
Question Bank (2 marks) · Q18

Q.Give an example for each valid variable and invalid variable.

Karnataka PUCTextbookShort· 2mImportance★★★★★est
58% · 90/154 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

[!TLDR]

Valid names follow C's identifier rules; names breaking them (digit-first, spaces, keywords) are invalid.

A variable name (identifier) in C must begin with a letter or underscore, may then contain letters, digits and underscores, must not contain spaces or special symbols, and must not be a keyword.

  • Valid: sum, total_marks, num1, _count (all obey the rules). …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.