cout.precision(3);
cout << 2.3456764 << endl;
should out : 2.34.
keep in mind precision specifies the number of significant digits, not the number of decimal places.
cout.precision(3);
cout << 2.3456764 << endl;
should out : 2.34.
keep in mind precision specifies the number of significant digits, not the number of decimal places.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.