private static void ParamExample(double radius, out double Area, out double Perimeter)
{
const double pi = 22/7;
Area = pi * radius * radius;
Perimeter = 2 * pi * radius;
}
It is similar to a reference parameter except that the initial value of the caller-provided argument is unimportant.
double rad = 10.0;
double area;
double pm;
ParamExample(rad, out area, out pm);
Console.WriteLine("For a circle of radius {0} : Area is {1} and Perimeter is {2}", rad, area, pm);
output parameter in .NET
See also
How to get the return value from C# program (console application)
How to Return Multiple Values from a VBA Function
Thanks, this was exactly what I was after.
ReplyDeleteIts good to know that C# Supports Multiple Inheritance,Multiple inheritance allows a class to take on functionality from multiple other classes.
ReplyDelete