fork download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. float f = 1.2001f;
  9. //cout << setprecision (2) << f << endl;
  10. cout << std::fixed << setprecision (2) << f << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
1.20