0

i want to store a range of numbers into an array or a string[]. the range in 1 - 100. Please help. here is the code i tried:

static Array SetNum()
        {
        var initial = Enumerable.Range(1, 100).ToArray();
        Console.WriteLine(initial.ToString());
        return initial;
}

When i tried to run the program. I got System.int32[] on the output.

soso
  • 311
  • 1
  • 4
  • 13

1 Answers1

1

It's a little unclear what you're trying to do. You description of your problem doesn't gel with the code. But my best guess, based on your code is this:

static int[] SetNum()
{
    var initial = Enumerable.Range(1, 100).ToArray();
    Console.WriteLine(String.Join(", ", initial));
    return initial;
}
Enigmativity
  • 113,464
  • 11
  • 89
  • 172