Hi, I'm wondering why when I print the result in the super simple program it will not display only 2 digits after the decimal point. What is the proper way of doing so? Thanks
Code:#include <iostream> #include <iomanip> using namespace std; int main () { int fah, i; float celsius; for (i = 1; i <= 4; i++) { cout << "Enter a Fahrenheit\n"; cin >> fah; celsius = (5.0 / 9.0) * (fah - 32.0); cout << "your answer is " << celsius << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setw(2) << " degrees celsius" << endl << endl; } system ("pause"); return 0; }