Question

Q1: 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

Answer

This answer is hidden. It contains 9 characters.