Interactive Quiz for Chapter 2

Question
Your Answer Result/Explanation
2.1
Write a statement to declare a variable named x of the double type with an initial value 4.5.
2.2
Write a statement to declare a constant named MAX of the int type with value 45.
2.3
15.0 / 2 =
2.4
15 / 2 =
2.5
15 % 2 =
2.6
Write an expression returns an integer from casting 1.7.
2.7
static_cast<int>(24.768 * 100) / 100.0 =
2.8
static_cast <int>(24.768 * 100) / 100 =
2.9
Use an augmented assignment operator to write a statement to add 5 into variable x.
2.10
Write an expression for 2.5 5.4.