Q:

Write a C# Sharp program to check the largest number among three given integers

0

Write a C# Sharp program to check the largest number among three given integers

Sample Output:

3
3
1
2

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;

namespace exercises
{
   class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(test(1,2,3));
            Console.WriteLine(test(1,3,2));
            Console.WriteLine(test(1,1,1));
            Console.WriteLine(test(1,2,2));
            Console.ReadLine();
        }

       public static int test(int x, int y, int z)
        {
            var max = Math.Max(x, Math.Max(y, z));
            return max;
        }
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now