I'v used this flag successfully before, but for some reason it won't format the numbers in this code. They keep coming back in scientific notation no matter where I set the flags. Does anyone know what I'm doing wrong? Here's the code:
double GetSquare(double x)
{
double a;
a = (sqrt(x));
return a;
}
int main()
{
double x;
cin >> x;
cout << setiosflags(ios::fixed) << setprecision(0)
<< endl << "The square root of "<< x << " is " << GetSquare(x)
<< endl <<endl;
return 0;
}