adplus-dvertising
frame-decoration

Question

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

namespace CompSciBitsConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            object[] o = new object[] {"1", 4.0, "CompSci", 'B'};
            fun (o);
        }
        static void fun (params object[] obj)
        {
            for (int i = 0; i < obj.Length-1; i++)
            Console.Write(obj[i] + " ");
        }
    }
}

a.

1 4.0 CompSci B

b.

1 4.0 CompSci

c.

1 4 CompSci

d.

1 CompSci B

Posted under C# programming

Answer: (c).1 4 CompSci

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

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