Review the solution to discover and implement a method call challenge activity
The following code is one possible solution for the challenge from the previous unit.
int firstValue = 500;
int secondValue = 600;
int largerValue;
largerValue = Math.Max(firstValue, secondValue);
Console.WriteLine(largerValue);
The Math.Max()
method supports 13 overloaded versions to accept different data types. The overloaded version of the Math.Max()
method that you call will accept int
as both input parameters, and returns the larger of the two values as an int
.
When you run the code, you should see the following output:
600
If you succeeded, congratulations! Continue on to the knowledge check in the next unit.
Important
If you had trouble completing this challenge, maybe you should review the previous units before you continue on.