Exercise: Determine Maximum of Two Numbers (Function)

Modify the program from Exercise: Determine Maximum of Two Numbers as follows.

  • Push the code that calculates the maximum into a function.

    • The function takes the numbers-to-compare as parameters.

    • The function returns the calculated maximum.

  • The rest of the program remains intact; only the function is called rather than implementing the comparison inline, top level.