I am trying to add values to an array and then return the whole array after 10 increments.
public int[] multi(int x)
{
int[] array = new int[10];
for (int i = 1; i < array.Length; i++)
{
array[i] = x;
x += x;
}
return array;
}
When i call the method, however, it simply returns System.Int32[]
, instead of (in this case) 5, 10, 15, 20 etc.
int[] result = lab.multi(5);
Console.WriteLine(result);
All help appreciated!