Exemple #1
0
    public static void Main(string [] ar)
    {
        overload obj = new overload();

        Console.WriteLine(obj.add(10, 20, 30)); //call to 2
        Console.WriteLine(obj.add(10.5, 90));   //call to 3
        Console.WriteLine(obj.add(10.5, 20.9)); //call to 5
        Console.WriteLine(obj.add(9, 10.5));    //call to 4
        Console.WriteLine(obj.add(10, 20));     //call to 1
        Console.WriteLine(obj.add(10));         //call to 1
    }
    // Main Method
    public static void Main(string[] args)
    {
        // Creating Object
        overload ol = new overload();

        int sum1 = ol.Add(20, 30);

        Console.WriteLine("sum of the two variables=" + sum1);


        int sum2 = ol.Add(22, 20, 15);

        Console.WriteLine("sum of the three variables=" + sum2);
        Console.ReadLine();
    }