4 of 40 | Multiple Choice @ Which of the following is not a valid string literal?
1“Freshair”
2‘freshair’
3freshair
4All of these
Answers
Answered by
0
Answer:
3. freshair
Explanation:
put string in either single apostrophe ' ' or double apostrophe " "
Answered by
0
freshair is not a valid string literal. Hence, option(c) is correct option.
- String are data types is used to store sequence of characters, variables, numbers, or symbols.
- The string can be declared in double quotes or single quotes.
- Double quotes are usually used to declare sentences and single quotes are used to declare characters in most languages.
- In 1st and 2nd examples, freshair is enclosed in double or single quotes.
- In option 3, freshair is not enclosed in any quotes so it is the incorrect way to declare string in most languages.
Similar questions