Hoàng Diễm Quỳnh
New member
What will be the output of the following C# code?
A. Compile time error
B.
25
0
C.
216
0
D.
216
25
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);
}
B.
25
0
C.
216
0
D.
216
25