C# Programming - Functions and Subroutines - Discussion

Discussion Forum : Functions and Subroutines - General Questions (Q.No. 21)
21.
What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            int i = 5;
            int j;
            fun1(ref i);
            fun2(out j);
            Console.WriteLine(i + ", " + j);
        }
        static void funl(ref int x)
        {
            x = x * x;
        }
        static void fun2(out int x)
        {
            x = 6; 
            x = x * x; 
        }
    }
}
5, 6
5, 36
25, 36
25, 0
5, 0
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
1 comments Page 1 of 1.

Smd said:   8 years ago
Please, anybody, explain this answer.

Post your comments here:

Your comments will be displayed after verification.