What Will Be The Output Of The Following C Codep Pre Langcsharp #326
What will be the output of the following C# code?</p> <pre><code class="language-csharp" line="1"> { struct abc { public int i; } class Program { static void Main(string[] args) { sample a = new sample(); a.i = 10; fun(ref a); Console.WriteLine(a.i); } public static voidn fun(ref sample x) { x.i = 20; Console.WriteLine(x.i); } } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Object Oriented Concepts - Structures - Quiz No.1.