Computer Science, asked by satkar1234, 6 months ago

find out valid and invalid identifiers in the folloeing identifiers: 1name, age student, marks1, city@, print​

Answers

Answered by Oreki
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 anindyaadhikari13
3

\star\:\:\:\sf\large\underline\blue{Question:-}

  • Find out the valid and invalid identifiers from the following.

\star\:\:\:\sf\large\underline\blue{Answer:-}

  1. 1name is an invalid identifier as identifier name must not start with digit.
  2. age student is an invalid identifier as identifier name must not contain any spaces.
  3. marks1 is a valid identifier.
  4. city@ is an invalid identifier as special characters are not allowed while naming an identifier.
  5. print is a valid identifier.
Similar questions