//* Example of formating printout *

#include <iostream> #include <iomanip> using namespace std; int main() { cout << showpoint << scientific << setprecision(2); /* OLDER COMPILES with .h libraries: cout << setiosflags(ios::showpoint) << resetiosflags(ios::scientific) << setiosflags(ios::scientific) << setprecision(2); */ cout << setw(15) << 123456.789012E-2 << endl; cout << setw(15) << 123456.789012E-5 << endl; cout << setw(15) << 1 << endl; cout << setw(15) << 123456.789012E+2 << endl; cout << setw(15) << 123456.789012 << endl; return(0); } /* 1.23e+003 1.23e+000 1 1.23e+007 1.23e+005 Press any key to continue */