Check the validity of the following identifiers:
(i) Mybook (ii) 2rno (iii) z2td (iv) date_2 (v) data-cs
Give the reason why some of these identifiers are invalid
Answers
Answered by
2
- Mybook is a valid identifier.
- 2rno is an invalid identifier. Reason:- identifier name must not start with a digit.
- z2td is a valid identifier.
- date_2 is a valid identifier.
- data-cs is an invalid identifier. Reason:- Hyphens are not allowed while naming an identifier.
Similar questions