adplus-dvertising
frame-decoration

Question

Which of the following tells C++ to display numbers with two decimal places?

a.

setdecimal(2)

b.

setiosflags(2)

c.

setiosflags(2.00)

d.

setprecision(2)

Answer: (d).setprecision(2)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following tells C++ to display numbers with two decimal places?