find out valid and invalid identifiers in the folloeing identifiers: 1name, age student, marks1, city@, print
Answers
Answered by
4
1name - Invalid, as identifiers can't start with a digit.
age student - Invalid, as identifiers can't contain a space between it.
marks1 - Valid
city@ - Invalid, as identifiers can't contain special characters like @, #.
print - Valid, as follows all rules of naming an identifier and it isn't a keyword.
Answered by
3
- Find out the valid and invalid identifiers from the following.
- 1name is an invalid identifier as identifier name must not start with digit.
- age student is an invalid identifier as identifier name must not contain any spaces.
- marks1 is a valid identifier.
- city@ is an invalid identifier as special characters are not allowed while naming an identifier.
- print is a valid identifier.
Similar questions