fork(3) download
  1. #include <iomanip>
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. double num1 = 3.12345678;
  7. double num = 3;
  8.  
  9. std::cout << num1 << std::endl;
  10. std::cout << std::setprecision(5) << num1 << std::endl;;
  11.  
  12.  
  13. std::cout << std::setprecision(5) << num << std::endl;;
  14. std::cout << num << std::endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
3.12346
3.1235
3
3