PiotrJurek

Zad13

Mar 29th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. float MAX(float a, float b, float c)
  6. {
  7. float m=a;
  8. if(b>=m)
  9. {
  10. m=b;
  11. }
  12. if(c>=m)
  13. {
  14. m=c;
  15. }
  16. return m;
  17. }
  18.  
  19. int main()
  20. {
  21. cout << MAX(5, 6, 2) << endl;
  22. cout << MAX(-69, 0, 42) << endl;
  23. cout << MAX(20.4, 20.3, -4.64) << endl;
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment