BrokeMansPC

Program 1 - 4.12.2020

Dec 4th, 2020 (edited)
664
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <math.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     float x,y,d;
  10.     cout << "Nikola Krudulj IV3" << endl;
  11.     cout << "X: ";
  12.     cin >> x;
  13.     cout << "Y: ";
  14.     cin >> y;
  15.     d = sqrt(pow(x, 2) + pow(y, 2));
  16.     cout << setw(7) << setprecision(3) << d;
  17.     return 0;
  18. }
  19.  
Add Comment
Please, Sign In to add comment