Advertisement
MeehoweCK

Untitled

Nov 13th, 2020
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int highest(int a, int b, int c)
  6. {
  7.     if(a >= b && a >= c)
  8.         return a;
  9.     if(b >= a && b >= c)
  10.         return b;
  11.     return c;
  12. }
  13.  
  14. int main()
  15. {
  16.     cout << "Please enter 3 numbers: ";
  17.     int x, y, z;
  18.     cin >> x >> y >> z;
  19.  
  20.     cout << "The highest value is " << highest(x, y, z) << endl;
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement