+ 1

How can i use Console.WriteLine to print names in an array

How can i use Console.WriteLine to print names in an array? Mine doesn't seem to work https://code.sololearn.com/cx9lKcf7zZ2w/?ref=app

21st Jan 2018, 12:37 PM
Rebin
Rebin - avatar
1 ответ
+ 3
You have to use a for-loop to iterate over each element in the array and print out each element individually, like this foreach(String k in Names){ Console.WriteLine(k); }
21st Jan 2018, 12:55 PM
Jente