Note: this is is just a repeated question found under C Programming: I am very sorry, please delete the message found in C Programming.
I am finding hard, what really the function to set the decimal places in two places using the compiler Borland C++ 3.0. I know already setprecission function that is found in the latest compiler such as borland c++ 4.5 or 5.5. But in Borland C++ 3.0 there is no function as setprecission found in the iomanip.h library.
I am using Borland C++ 3.0. Hope you can help me this thing.
I want to display the output into two decimal places, I know the solution using setprecission such as:
float a, b, c, average;
while (a <= 3)
cout <<"Enter number: ";
cin >> b;
c = c + b;
average = c / a;
cout << average;
But the problem is I could not find setprecission in Borland C++ 3.0 compiler. Thanks in advance...
cout << average << setprecission(2);