0
Numbers after decimal point
What is the function for defining the number 0 after decimal point in c++ For example: double a; a=3.000 std::cout << a; // it will print 3 in console. what function should I add to this program to print 3.000
1 Answer
+ 1
You need to:-
#include <iomanip>
cout << showpoint << setprecision(4) << a << endl;