Friday 16 December 2011

61. What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[] args)
        {
            int[]arr = newint[]{ 1, 2, 3, 4, 5 };
            fun(ref arr);
        }
        static void fun(ref int[] a)
        {
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = a[i] * 5;
                Console.Write(a[ i ] + " ");
            }
        }
    }
}
A.1 2 3 4 5
B.6 7 8 9 10
C.5 10 15 20 25
D.5 25 125 625 3125
E.6 12 18 24 30
Answer: Option C