What will be the output of the following C# code? [code] static void Main(string[] args) { int i = 5; int j = 6; add(ref

What will be the output of the following C# code?
Code:
 static void Main(string[] args)
 {
     int i = 5;
     int j  = 6;
     add(ref i);
     add(6);
     Console.WriteLine(i);
     Console.ReadLine();
 }
 static void add(ref int x)
 {
     x = x * x;
 }
 static void add(int x)
 {
     Console.WriteLine(x * x * x);
 }
A. Compile time error
B.
25
0
C.
216
0
D.
216
25
 

Tìm kiếm

Back
Top