Output Parameter In C Sharp


This program descirbe the concept of Output Parameter in C#
---------------------------------------------------------------
using System;

class OutputParameter
{
static void Main()
{
int a = 10,b =20;
int c; //Notice i did not assign any value variable b.
Sum(a,b,out c);

Console.WriteLine("The value after sum is " + c);
}
static void Sum(int a, int b, out int c)
{
c = a+ b;
}
}
-------------------------------------------------------------------------------


------------------------------------------------------------------------------
Output Parameter In C Sharp Output Parameter In C Sharp Reviewed by Baljeet Singh on 02:04 Rating: 5

No comments:

Powered by Blogger.