Computer Science, asked by inayathkhan373, 8 months ago

Find the invalid identifier from the following

a) MyName b) True c) 2ndName d) My_Name

Answers

Answered by mad210203
13

2ndName (Option C)

Explanation:

  • Identifier is used to give names to the variables, functions, unions, structures, enums etc..
  • Identifiers should be unique, they should not match with the key words.
  • A identifier can contain alphabets (Upper or lower case), numbers, a special character underscore ( _ ).
  • The first letter of an identifier should be a alphabet or underscore. A number cannot be the first letter of the identifier.
  • But in option C, the first letter is 2, which is a number.
  • So, it is a invalid identifier.

Therefore, option C is correct answer.

Similar questions