Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float Max_price_item(float, float, float);
- float swap_value(float, float);
- int main()
- {
- cout << "Enter three item prices"<<endl;
- float x = 0, y = 0, z = 0;
- cin >> x;
- cin >> y;
- cin >> z;
- float r = Max_price_item(x, y, z);
- cout << "max is :" << r << endl;
- float swap = swap_value(x, y);
- cout << swap << endl;
- system("pause");
- }
- float Max_price_item(float a, float b, float c)
- {
- float max = 0;
- if (a > b && a > c)
- max = a;
- else if (b > a && b > c)
- max = b;
- else
- max = c;
- return max;
- }
- float swap_value(float a, float b)
- {
- float r = 0;
- a = b;
- r = b;
- return r;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement