Question: 6. Briefly explain what is wrong with the following code int x = 5; int y = y * x; 7. Given the following
6. Briefly explain what is wrong with the following code int x = 5; int y = y * x; 7. Given the following C++ piece of code: double width = 2.9; double height= 3; int surface = width * height; cout < < "Surface = " < < surface; What is the printout of this code? 8.7, 8.07, 9, 9.0, or 8 Explain why?
Step by Step Solution
There are 3 Steps involved in it
6 The code int x 5 int y y x is wrong because the variable y is used before it i... View full answer
Get step-by-step solutions from verified subject matter experts
