1.

Identify the invalid literals from the following and write reason for each: 1. 2E3.5 2. “9”3. ‘hello’ 4. 55450

Answer»

1. 2E3.5 → The mantissa part (3.5) will not be a floating point number. Hence it is invalid 

3. ‘hello’ → It is a string hence it must be enclosed in double quotes instead of single quotes. It is invalid.



Discussion

No Comment Found

Related InterviewSolutions