My assignment involve printing out double numbers with 2 digits after the decimal point. In one of the example tests, I got the output is 78.125. My teacher taught me to use the setprecision function to print out the number
#include <iomanip>
...some code
cout << fixed << setprecision(2);
cout << x /*the number*/
Normally this would do just fine. However the example output is 78.13 while the output of my code is 78.12. I can't figure out anyway to do this.