I was trying to set the precision to 6 digits but using setprecision(6)
alone doesn't do the trick. Why?
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float num = 1.423;
cout<<setprecision(6)<<num;
return 0;
}
It results in 1.423
only rather then 1.423000
until I use fixed
cout<<setprecision(6)<<num;