Quiz for:

Types of Literal Constants in C++

Question 15

What does the prefix '0b' usually indicate in binary notation?

A.Decimal notation
B.Binary notation
C.Octal notation
D.Hexadecimal notation

Question 1

What is an integer literal?

A.A number that has a decimal point
B.A single character enclosed in quotes
C.A number without any fractional or decimal part
D.A sequence of characters enclosed in quotes

Question 2

Which notation in C++ represents an integer literal prefixed with 0x?

A.Decimal notation
B.Binary notation
C.Octal notation
D.Hexadecimal notation

Question 3

What is the range of digits for a hexadecimal integer literal?

A.0 to 9
B.0 to 7
C.0 to 15
D.0 to 1

Question 4

What prefix is used for representing an integer in octal notation?

A.0b
B.0x
C.0
D.0o

Question 5

In C++, what does adding a 'u' or 'U' suffix to an integer literal mean?

A.It represents a float value
B.It represents a signed integer
C.It represents an unsigned integer
D.It makes the integer long

Question 6

What does a floating point literal represent?

A.A sequence of characters
B.A number with a fraction or a decimal point
C.A single character enclosed in quotes
D.A boolean value

Question 7

What is the default type for a floating point literal in C++?

A.Integer
B.Float
C.Double
D.Character

Question 8

How is a character literal in C++ defined?

A.A single character enclosed in double quotes
B.A sequence of characters enclosed in double quotes
C.A single character enclosed in single quotes
D.A number with a decimal point

Question 9

What is an escape character in C++?

A.A string enclosed in double quotes
B.A character not enclosed in quotes
C.A special type of character literal often used to represent non-printable characters
D.A number without decimal part

Question 10

What is the ASCII value for the character literal 'A'?

A.64
B.65
C.66
D.67

Question 11

What differentiates a string literal from a character literal in C++?

A.A character literal uses double quotes while string uses single
B.A string literal uses double quotes while character uses single
C.There is no difference
D.A string literal can only contain numbers

Question 12

In C++, what value does the boolean literal 'true' equate to?

A.0
B.-1
C.1
D.2

Question 13

What automatically gets added at the end of a string literal?

A.A space
B.A null terminator
C.A newline character
D.An underscore

Question 14

How are arithmetic operations possible with character literals?

A.They are treated as integers internally
B.They are stored as strings
C.They aren't possible
D.Because of their special notation

Question 15

What does the prefix '0b' usually indicate in binary notation?

A.Decimal notation
B.Binary notation
C.Octal notation
D.Hexadecimal notation

Question 1

What is an integer literal?

A.A number that has a decimal point
B.A single character enclosed in quotes
C.A number without any fractional or decimal part
D.A sequence of characters enclosed in quotes
    quiz: Understanding Integer Literals and Notations in C++ Programming