Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
    object[] a = {" 1 ", 4.0f, " harsh "};
    fun(a);
    Console.ReadLine();
}
static void fun(params object[] b)
{
    for (int i = 0; i < b.Length - 1; i++)
        Console.WriteLine(b[i] + " ");
}

A. 1 4.0 harsh

B. 1 4

C. 1 4 hars

D. 1 4 harsh

Answer: Option D


Join The Discussion

Related Questions on Arrays and Strings in C Sharp