lahlousara200 lahlousara200
  • 13-03-2021
  • Computers and Technology
contestada

Write a cout statement so the variable sales is displayed with a precision of three decimal places, with the decimal point always displayed.

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 18-03-2021

Answer:

The statement is as follows:

cout <<fixed<< setprecision(3) <<sales;

Explanation:

Here, I assume that the variable has already been declared.

The syntax to use is:

cout<<fixed<<setprecision(n)<<variable-name;

In this case:

[tex]n = 3[/tex] --- i.e. to 3 decimal places

And the variable name is: sales

So, when implemented, the instruction is:

cout <<fixed<< setprecision(3) <<sales;

Answer Link

Otras preguntas

pls help, what goes in those spaces, there are letters for hints
What role did the battles between Chinese and the Turks have on the history of the region?
A new bullet the mini ball makes the civil war more deadly than previous wars which country invented it
When the makers of Reese's candy bars decided to manufacture Reese's peanut butter, it was an example of
Even though Adoniram suffered many hardships, he continued to share the gospel with the people of Burma. How many years did he work in Burma
What is the slope of this line?​
During the time of exploration, why did Spain have more success gaining control over the native populations in Mexico and the Andes than in other regions of Nor
Write the expression 83⋅83⋅83⋅83⋅83⋅83 as a power.Enter your answer by filling in the boxes.$
what is the solution of the equation ? 3=2w
What most likely would have happened if North Carolina’s waterways had been dredged like Archibald Murphey suggested?Raleigh would have experienced rapid growth