Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. float Max_price_item(float, float, float);
  5. float swap_value(float, float);
  6. int main()
  7. {
  8. cout << "Enter three item prices"<<endl;
  9. float x = 0, y = 0, z = 0;
  10. cin >> x;
  11. cin >> y;
  12. cin >> z;
  13. float r = Max_price_item(x, y, z);
  14. cout << "max is :" << r << endl;
  15. float swap = swap_value(x, y);
  16. cout << swap << endl;
  17.  
  18.  
  19.  
  20.  
  21. system("pause");
  22.  
  23. }
  24. float Max_price_item(float a, float b, float c)
  25. {
  26. float max = 0;
  27. if (a > b && a > c)
  28. max = a;
  29. else if (b > a && b > c)
  30. max = b;
  31. else
  32. max = c;
  33. return max;
  34.  
  35. }
  36. float swap_value(float a, float b)
  37. {
  38. float r = 0;
  39. a = b;
  40. r = b;
  41. return r;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement