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

When no living members of a species exist, the species _____. has gone extinct needs protection is endangered lost its habitats
he shrimp in the photograph are small crustaceans, related to lobsters and crabs. mc023-1.jpg Photo by Russ Hopcroft, courtesy of the NOAA Which specialized c
Do .03 and 3.0 have the same value
What is the longest stick that can be placed inside a box 15 cm long 20 cm wide and 60 cm high?
Please select the word from the list that best fits the definition Your best friend tú Usted Ustedes
Which of the following is an example of using physical capital instead of human capital to get a job done? A. furniture made by hand B. a server in a fast-foo
Expand and evaluate the power. (0.4)2 A. 0.16 B. 0.6 C. 0.8 D. 1.6
Use the equation to complete the table.
True or False, The Occupational Outlook Handbook is a reference book designed to help determine personality types?
What purpose do warning labels on tobacco products serve?