Which of the following identifiers is invalid
A. printname
B. enum
C. writername
D. papername
Answer: Option B
Solution (By Examveda Team)
Identifiers are names given to variables, functions, classes, etc., in programming languages.Valid identifiers can include letters (a-z, A-Z), digits (0-9), and underscores (_), but they cannot start with a digit.
Option A: printname - This is a valid identifier as it follows the rules.
Option B: enum - This is an invalid identifier because enum is a reserved keyword in many programming languages (e.g., C, C++, Java, Python). Keywords cannot be used as identifiers.
Option C: writername - This is a valid identifier as it follows the rules.
Option D: papername - This is a valid identifier as it follows the rules.
Therefore, the correct answer is Option B: enum.

Join The Discussion