adplus-dvertising
frame-decoration

Question

What will be the output for the given set of 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

Posted under C# programming

Answer: (d).1 4 harsh

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 for the given set of code ?