fork(30) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. long double num = 5871.9854015241057;
  7. cout.precision(2);
  8. cout << "Scientific (default): " << num << endl;
  9. cout.setf(ios_base::fixed);
  10. cout << "Fixed: " << num << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Scientific (default): 5.9e+03
Fixed: 5871.99