Question: c++ 4. Look at the following code: int x = 5, y = 3, 2 = 7; int f = 3, 8 = 5; float

c++
c++ 4. Look at the following code: int x = 5, y

4. Look at the following code: int x = 5, y = 3, 2 = 7; int f = 3, 8 = 5; float d = -3 / 4 + 6 / 4; float w = (x / y) + (z / x); float q = f / g + 3 / 2; cout Obviously, the numbers are being truncated. Use your knowledge of casting to modify the above code so that the output looks like this: 0.75 3.06667 2.1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!