Question
Identify invalid variable names from the following, give reason for each:
Group, if, int, total marks, S.I., volume,
tot_strength, #tag, tag$, 9a

Answer

Group : Valid
if: not Valid as it is a Keyword
int:not Valid as it is a Keyword
total marks:not Valid as space cannot be a part of variable name.
S.I. :not Valid, No Special character can be part of variable name, (.) is special character.
Volume: Valid
tot_strength: valid
#tag: not Valid, No Special character can be a part of variable name, (#) is special character.
tag$: not Valid, no Special character can be a part of variable name, ($) is special character.
9a: not Valid, cannot start with number.

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free