I am trying to hold integer inputs into an array but it doesn't work. I found an example for string hold from How to Fill an array from user input C#?
string[] yazi = new string[15];
for (int i = 0; i < yazi.Length; i++)
{
yazi[i] = Console.ReadLine();
}
But when I turn this code to integer, it gave an error
int[] sayis = new int[20];
for (int k = 0; k < sayis.Length; k++)
{
sayis[k] = int.Parse(Console.ReadLine());
}
Am I missing something?