adplus-dvertising
frame-decoration

Question

What will be the output the of given set of code?
static void Main(string[] args)
 {
     int [] a = {1, 2, 3, 4, 5};
     fun(a);
     Console.ReadLine();
 }
 static void fun(params int[] b )
 {
     for (int i = 0; i < b.Length; i++)
     {
         b[i] = b[i] * 5 ;
         Console.WriteLine(b[i] + "");
     }
 }

a.

1, 2, 3, 4, 5

b.

5, 10, 15, 20, 25

c.

5, 25, 125, 625, 3125

d.

6, 12, 18, 24, 30

Posted under C# programming

Answer: (b).5, 10, 15, 20, 25

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