#include #include const float x = 123.456123456789012345; main () { cout << "The number is "; cout << x << endl;; cout << "With a setw of 2,8,10 " << endl; cout << " 2 " << setw(2) << x << endl; cout << " 8 " << setw(8) << x << endl; cout << "10 " << setw(10) << x << endl; cout << endl; cout << "Setprecision(2) and with a setw of 2,4 " << endl; cout << setprecision(2); cout << " 2 " << setw(2) << x << endl; cout << " 4 " << setw(10) << x << endl; cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint); cout << endl; cout << "Setprecision(2) and with a setw of 2,4, after showpoint " << endl; cout << " 2 " << setw(2) << x << endl; cout << " 4 " << setw(10) << x << endl; cout << endl << "Setprecision(5) no setw" << endl; cout << setprecision(5); cout << x << endl; cout << endl << "Setprecision(10) no setw " << endl; cout << setprecision(10); cout << x << endl; }