Use of Call By Out parameter in a console application.

Tripati_tutu
Posted by Tripati_tutu under C# category on | Points: 40 | Views : 2068
See the below sample code.
public class Class1
{
public void Add(int x, int y, out int res)
{
res = x + y;
}
static void Main(string[] args)
{
Class1 obj = new Class1();
int a = 10, b = 20, res;
obj.Add(a, b, out res);
Console.WriteLine("Result is =" + res);
Console.ReadKey();
}
}

Comments or Responses

Login to post response