Saturday, 25 May 2013

C# Simple Program of Out variable


Simple Program of Out variable

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

namespace paraout

{

    class Program

    {

        static void Main(string[] args)

        {

            int a, b, c, d;

            a = 10;

            b = 20;

            process(a, b, out c, out d);

            Console.WriteLine("Addition " + c);

            Console.WriteLine("Difference " + d);

        }

        static void process(int x, int y, out int i, out int j)

        {

            i = x + y;

            j = x - y;

        }

    }

}

No comments:

Post a Comment