Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int MAX(int a, int b, int c)
- {
- if(a>b)
- {
- if(a>c)
- {
- return a;
- }
- else
- {
- return c;
- }
- }
- else if(b>a)
- {
- if(b>c)
- {
- return b;
- }
- else
- {
- return c;
- }
- }
- }
- int main()
- {
- cout << MAX(1,2,4) << endl;
- cout << MAX(5,111,32) << endl;
- cout << MAX(49,33,41) << endl;
- cout << MAX(8,29,1) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement