Chapter 3 Quiz Starting Out With C++ 017

 To calculate the average of two numbers in C++

a. x + y/2
b. (x + y)/2
c. x/2 + y
d. All of the above

Chapter 3 Quiz Starting Out With C++ 016

 How do you do exponents in C++ for 2.0 raised to 4.0

a. 2.0^4.0
b. pow(2.0, 4.0)
c. 2.0*4.0
d. None of the above

Chapter 3 Quiz Starting Out With C++ 015

How do you write the sum of X plus Y divided by Z in C++

a. x + y/z
b. (x +y)/z
c. X + Y/Z
d. (X + Y)/Z

Chapter 3 Quiz Starting Out With C++ 014

In the following expression what is the answer

6 * (2 + 4) - 5

a. 11
b. 31
c. 6
d. None of the above

Chapter 3 Quiz Starting Out With C++ 013

 What has the lowest precedence?

a. * (asterick)
b. / (division)
c. + (plus)
d. - (unary negation)

Chapter 3 Quiz Starting Out With C++ 012

What is operator precedence?

a. What numbers will be processed first.
b. What expressions are stored before others
c. Some types are stored higher in memory
d. Some operators are evaluated before others