How to use Math.Max() that return the larger of two numbers in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n1 = -289;
            int n2 = 5;

            int max = Math.Max(n1, n2);

            Console.WriteLine(max);
        }
    }
}


/*
run:

5

*/

 



answered Jan 3, 2017 by avibootz
...