Chapter 2 questions - Easy semester

For instance, if x, y and z are 1, 2 and 4, the double average should be 2.33333 but average will instead be 2.00000. What is output if x = 0, y = 1 and z = 1? 0 0.0 0.6666666666666666 0.6666666666666667 0.67 Answer: b. Explanation: The division is performed as an int division since x, y, z and 3 are all ints. Therefore, average gets the value 0.0. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download