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

If a number has an absolute value equal to -23, that number could be a.-23 b.23 c.23 or -23 d. A number cannot have an absolute value of -23
which digits can replace the_ to make a true statement? 6,456<6,_12<6,788
whats 77557747 plus 94948;7;
sixteen less than the product of four and a number is equal to negative four
How did mummification reflect Egyptian beliefs about the afterlife?
If a nail reacts with oxygen is it a physical property or chemical
how many atoms of iron are there in 2.5 moles of wolframite
What a comparison sentence for this equation.plz help!!
Order the numbers from Greatest to least 15℅,3/4,3.27,3√27,√11
Which of the following are you not likely to find on a historical map of World War II