Volodymyr H.

asked • 12/08/22

I need an answer for the question below. Please help ASAP. Thank you. It is in C#

Paste the following code into the main() method. Modify the code; so that it works (You’ll have to make 3 small modifications). It should output the value of each string in the array called colors.

the code is

using System;


class GFG

{


// Main Method

static public void Main(String[] args)

{

string[] colors = { "Green", " Red", " Blue", " Yellow", " Pink" };


for (int j = 1; j <= colors.Length; j++)

{

Console.WriteLine(colors[0]);

}


}

}


1 Expert Answer

By:

Kevin C. answered • 12/16/22

Tutor
5 (1)

Experienced Computer Programmer Looking to Share Knowledge

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.