What will be output by the following statements?


double x = 1.23456789;
cout << fixed;
cout << setprecision(5) << x << endl;
cout.precision(3);
cout << x << endl;
cout << x << endl;

a. 1.2346
1.23
1.23
b. 1.23457
1.235
1.23456789
c. 1.2346
1.23
1.23456789
d. 1.23457
1.235
1.235

d. 1.23457
1.235
1.235

Computer Science & Information Technology

You might also like to view...

Describe the Mac OS X operating system.

What will be an ideal response?

Computer Science & Information Technology

Two anchor points aligned on both the horizontal and vertical axis are automatically joined.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology