C# Maths

In C# there is a Math class that has many methods to perform different mathematical tasks. Some of the methods are discussed in program below.

using System;
  
namespace LearningProgram
{   
    class LearnProgram
    {   
        // Main function
        static void Main(string[] args)
        {
            int a = 4, b = 5;
            // Math.Max() method finds the max between the given arguements.
            Console.WriteLine("Bigger number is: "+Math.Max(a,b));
            // Math.Min() method finds the minimum between the given arguements.
            Console.WriteLine("Samller number is: "+Math.Min(a,b));
            // Math.Sqrt() method finds the square root of the given arguement.
            Console.WriteLine("Square root of 4 is, "+Math.Sqrt(a));
            // Math.Abs() method finds the Absolute value of the given arguement.
            Console.WriteLine("Absolute Value of 4.7 is, "+Math.Abs(-4.7));
        }
    }
}