Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 207

C# function to return array and write the array in the Console

$
0
0

This is a function to get integer numbers from Console, this parte works right. The trouble is in the part of write the values from the array.

Console.WriteLine("Function get numbers...");static int[] numbers(int[] values){    for(int ind = 0; ind < 10; ind++){        Console.WriteLine("Type a number: ");        values[ind]= int.Parse(Console.ReadLine());    }    return values;}numbers(new int[10]);for(int s= 1; s < 10; s++){    Console.WriteLine(numbers(new int[s]));}

I I looked in the documentation but I didn't find a solution.


Viewing all articles
Browse latest Browse all 207

Trending Articles