ProAnswers.org

How to limit floating point precision in C++ in cout?

How do you limit the floating in C Plus Plus in output statement?

use setprecision

cout << setprecision(5) << floatNumber << endl; // prints 1.2345