I would like the output to print 4.0.
When the program runs it prints 4.
I've tried changing setprecision and changing float type to double, but no difference.
What am I missing here?
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
#include <iomanip>
usingnamespace std;
float x = 4.0;
int main()
{cout << "Float is " << setprecision(2) << x <<endl;
return 0;
}