What data type is the data "99" (with quotation marks)?

Study for the End of Year 8 Computer Science Test. Prepare with flashcards and multiple choice questions, each with hints and explanations. Get ready for your exam!

Multiple Choice

What data type is the data "99" (with quotation marks)?

Explanation:
When data is written with quotation marks, it is treated as text—a string. The characters inside the quotes are a sequence of symbols, not a numeric value. So "99" is a string containing the digits 9 and 9 as characters. It isn’t a numeric type unless you convert it. If you wanted arithmetic, you’d convert it to a number (e.g., 99 as an integer). Without quotes, 99 would be an integer, and 99.0 would be a float. Booleans are true/false and not digits. So the data type of "99" is a string.

When data is written with quotation marks, it is treated as text—a string. The characters inside the quotes are a sequence of symbols, not a numeric value. So "99" is a string containing the digits 9 and 9 as characters. It isn’t a numeric type unless you convert it. If you wanted arithmetic, you’d convert it to a number (e.g., 99 as an integer). Without quotes, 99 would be an integer, and 99.0 would be a float. Booleans are true/false and not digits. So the data type of "99" is a string.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy