Identify the invalid literals from the following and write reason for each: 1. 2E3.5 2. “9”

Hi, I have a question and I hope anyone could answer it:

Identify the invalid literals from the following and write reason for each: 

1. 2E3.5 

2. “9”

3. ‘hello’ 

4. 55450

Related Questions

You must login to add an answer.

1 Answer

  1. 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