What data type is the literal -11?

Prepare for the EOY8 Computer Science Exam. Enhance your skills with interactive quizzes and detailed explanations to ensure success. Start your journey to achieve great results!

Multiple Choice

What data type is the literal -11?

Explanation:
A negative numeric literal with no fractional part is an integer. The value -11 has no decimal point, so it’s classified as an integer, with the minus sign simply applying negation to the number 11. It isn’t a boolean (true/false), not a string (text), and not a float (which would include a decimal point like -11.0 or -3.14).

A negative numeric literal with no fractional part is an integer. The value -11 has no decimal point, so it’s classified as an integer, with the minus sign simply applying negation to the number 11. It isn’t a boolean (true/false), not a string (text), and not a float (which would include a decimal point like -11.0 or -3.14).

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy