fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int max(int x, int y) {
  5.  
  6. int result;
  7. if (x > y) {
  8. result = x;
  9. } else {
  10. result = y;
  11. }
  12. return result;
  13.  
  14. }
  15.  
  16. int main() {
  17.  
  18. int x = 10, y = 20;
  19. cout << "MAX = " << max(x, y) << endl;
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5548KB
stdin
Standard input is empty
stdout
MAX = 20