pastebin

Paste Search Dynamic
Recent pastes
setprecision
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main()
  5. {
  6.     double number1 = 142.384, number2 = 28.911;
  7.     double quotient = number1 / number2;
  8.     cout << quotient << endl;
  9.     cout << setprecision(5) << quotient << endl;
  10.     cout << setprecision(4) << quotient << endl;
  11.     cout << setprecision(3) << quotient << endl;
  12.     cout << setprecision(2) << quotient << endl;
  13.     cout << setprecision(1) << quotient << endl;
  14.     return 0;
  15. }
Parsed in 0.007 seconds