C++

Float precision

Include iomanip library and cout << fixed << setprecision(2) << x;