230k views
1 vote
Suppose that x = 1565.683, y = 85.78, and z = 123.982. What is the output of the following statements? cout << fixed << showpoint; cout << setprecision(3) << x << ' '; cout << setprecision(4) << y << ' ' << setprecision(2) << z << endl;

User Dan Bryant
by
5.9k points

1 Answer

5 votes

Answer:

The output to the given question is "1565.683 85.7800 123.98".

Explanation:

In the given C++ program there are three variable is defined that is x,y, and z.To print the value of the variable we use the setprecision() function. we use the setprecision() function. It is also known as manipulator setprecision() function. This function used to control the number of digits and display the number of a floating-point value. The setprecision() function work only with the "<iomanip>" header file.

User EBS
by
6.0k points