Chapter 3 Quiz Starting Out With C++ 023

What is an Overflow

a. When you try to use a value larger the the data type of the variable
b. When the computer runs out of memory
c. When a variable is uninitialized
d. None of the above

Chapter 3 Quiz Starting Out With C++ 022

In C++, if you divide the integers 7 by 2 the answer will be

a. 3.5
b. 3
c. 2
d. undefined since the answer is a float

Chapter 3 Quiz Starting Out With C++ 021

 When the final value of an expression is assigned to a variable, it will be converted
to the data type of that variable.

a. True
b. False

Chapter 3 Quiz Starting Out With C++ 020

When an operator works with two values of different data types, the lower-ranking
value is promoted to the type of the higher-ranking value.

a. True
b. False

Chapter 3 Quiz Starting Out With C++ 019

chars, shorts, and unsigned shorts are automatically promoted to type int.

a. True
b. False

Chapter 3 Quiz Starting Out With C++ 018

What happens in C++ when operator's operands are of different types?

a. Nothing
b. C++ will convert to the same data type
c. C++ will convert to the largest data type
d. C++ will convert to the lowest data type