Guest User

Untitled

a guest
Dec 7th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment