Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
   int a = 5;
   fun1 (ref a);
   Console.WriteLine(a);
   Console.ReadLine();
}
static void fun1(ref int a)
{
    a = a * a;
}

A. 5

B. 0

C. 20

D. 25

Answer: Option D


Join The Discussion

Related Questions on Classes and Objects in C Sharp