Which of the following will be the correct output for the C#.NET pr

Loading

โœช Choose the correct option.

Which of the following will be the correct output for the C#.NET program given below?

namespace ConsoleApplication {
struct Sample {
public int i;
};
class MyProgram {
static void Main() {
Sample x = new Sample();
x.i = 10;
fun(x);
Console.Write(x.i + " ");
}
static void fun(Sample y) {
y.i = 20;
Console.Write(y.i + " ");
}
};
}

A. 10 20
B. 44844
C. 44854
D. 20 20

Leave a Comment