Question Bank (5 marks) · Q5
Q.Write the rules for forming identifier name.
Karnataka PUCTextbookLong· 5mImportance★★★★★est
18% · 28/154 Questions
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]
An identifier must start with a letter or underscore, contain only letters/digits/underscore, avoid keywords and spaces, and is case-sensitive.
An identifier is the name used to identify a variable, function, array, or other user-defined item. C lays down the following rules for forming a valid identifier name:
- The first character must be an alphabet (A-Z or a-z) or an underscore ( _ ).
- The subsequent characters may be letters, digits (0-9) or the underscore.
- No special characters (except the underscore) and no blank spaces are allowed.
- A keyword (reserved word such as int, for, while) cannot be used as an identifier.
- Identifiers are case-sensitive - Sum, SUM and sum are three different names.
- It should preferably be short and meaningful; many compilers treat only the first few characters as significant. …
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.