Function Parameter in C#

Posted by Prabhukiran345 under C# category on | Points: 40 | Views : 488
Parameter is the essential part of function. However, it is optional but it makes C# function more dynamic than simple function. There are two type of function parameter in C#, Value type parameter and reference type parameter

using System;

namespace Understanding_Parameter
class Program
// function with parameter
public static int power(int num1)
int result;
result = num1 * num1;
return result;

static void Main(string[] args)
int pow;
// passing arguement as parameter
pow = Program.power(5);
Console.Write("\nPower = {0}", pow);

Power = 25

Comments or Responses

Login to post response