Answer the question
In order to leave comments, you need to log in
How to reduce the number of digits after the decimal point in C++ output?
The result is 3.9616316
Need to get only 2 digits after the dot on the output?
Just learning C++
Answer the question
In order to leave comments, you need to log in
double a=10.345724;
cout << setprecision(2) << fixed << a << endl;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question