Exemplo n.º 1
0
        static void Main()
        {
            //out parameter
            float        num1 = 10, num2 = 80, sum = 0, product = 0;
            int          length = 10, cal = 0;
            Out_ParamsEg obj = new Out_ParamsEg();

            obj.Calculation(num1, num2, length, out sum, out product, out cal);
            if (sum > 0 && product > 0)
            {
                Console.WriteLine("sum:{0}|| product:{0}|| cal{2}", sum, product, cal);
            }
            Console.WriteLine("---------------------------------");
            obj.Studentdetails("edward", "singing", "playing", "reading");
            Console.WriteLine("Demo Msg");
            Console.Read();
        }
Exemplo n.º 2
0
        static void Main()
        {
            //Out parameter
            float        num1 = 10, num2 = 80, sum = 0, product = 0;
            int          length = 10, cal = 0;
            Out_ParamsEg obj = new Out_ParamsEg();

            obj.Calculation(num1, num2, length, out sum, out product, out cal);
            if (sum > 0 && product > 0)
            {
                Console.WriteLine("sum:{0}||product:{1}||cal{2}", sum, product, cal);
            }
            Console.WriteLine("----------------------------------");
            //string[]h=new string[3]{"Singing","Playing","Reading");
            //params is keyword which is used to speicfy a parameter that is permitted after the params keyword in
            //obj.Studentdetails("sunitha","Singing","Playing","Reading","Chennai",90,80);
            obj.Studentdetails("Edward", "Singing", "Playing", "Reading");

            Console.Read();
        }
Exemplo n.º 3
0
        static void Main()
        {
            //Out PArameter
            float        num1 = 10, num2 = 80, sum = 0, product = 0;
            int          length = 10, cal = 0;
            Out_ParamsEg obj = new Out_ParamsEg();

            obj.Calculation(num1, num2, length, out sum, out product, out cal);
            if (sum > 0 && product > 0)
            {
                Console.WriteLine("Sum:{0}||Product{1}||Cal:{2}", sum, product, cal);
            }
            Console.WriteLine("_____________________________________");
            //string[]h= new string[3]{"Singing","Playing","Reading"};
            //params is keyword which is used to specify a parameter that takes variable no. of arguments
            //only one params is allowed & no additional parameter is permitted after the params keyword
            //obj StudentDetails("Sunitha","Singing","Playing","Reading","Chennai",90,80)
            obj.studentdetails("Edward", "Singing", "Playing", "Reading");
            Console.Read();
        }