home *** CD-ROM | disk | FTP | other *** search
- // \EXAMPLES\EX1109.CPP
-
- #include <iostream.h> // include I/O Stream definitions
- #include <iomanip.h> // include manipulator definitions
-
- void main() {
- float f =6.6666666;
- cout.precision(2); // set floating-point precision of cout
- cout << "Here is f with precision 2: " << f << endl;
- cout << "Here is f with precision 4: "
- << setprecision(4) << f << endl;
- }
-