daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <ios>
  3. #include <iomanip>
  4.  
  5. using std::cin;
  6. using std::cout;
  7. using std::endl;
  8. using std::setprecision;
  9. using std::streamsize;
  10.  
  11. int main()
  12. {
  13.     double x;
  14.     double y;
  15.  
  16.     cout << "tal nr 1: ";
  17.     cin >> x;
  18.     cout << endl << "tal nr 2: ";
  19.     cin >> y;
  20.  
  21.     streamsize prec = cout.precision();
  22.     cout << endl << "NR 1 + NR 2 = " << setprecision(3) << x + y << endl;
  23.     cout << "NR 1 * NR 2 = " << x * y << endl;
  24.     cout << "NR 1 - NR 2 = " << x - y << endl;
  25.     cout << "NR 1 / NR 2 = " << x / y << endl << setprecision(prec);
  26.  
  27.     system ("pause");
  28.  
  29.     return 0;
  30. }
RAW Paste Data
Top