Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Fill an array from user input C#?

Tags:

c#

What would be the best way to fill an array from user input?

Would a solution be showing a prompt message and then get the values from from the user?

like image 674
arin Avatar asked Oct 23 '08 16:10

arin


1 Answers

string []answer = new string[10];
for(int i = 0;i<answer.length;i++)
{
    answer[i]= Console.ReadLine();
}
like image 157
Patrick Desjardins Avatar answered Sep 19 '22 14:09

Patrick Desjardins