Answer:
The answer with explanation and output result is provided below.
Explanation:
setprecision(n) manipulator controls the number of places after the decimal point. setprecision(8) will display 8 significant digits, padded with trailing zeroes.
fixed manipulator sets the output in a fixed decimal format.
showpoint manipulator makes sure the display of a decimal point.
setprecision(n) and fixed manipulator should be used together otherwise it might not show the trailing zeroes.
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double number=12.0;
cout<<fixed<<showpoint<<setprecision(8)<<number<<endl;
return 0;
}
Output:
12.00000000