0

I want to make an array that takes a number and makes a "n length" array with random number. I do not really know if i need to make a random number generator for it or no the variable type must be string or it does not matter if we wanna a make an array with numbers

   using System;

namespace arrays
{
    class arrays
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Add A Number: ");
            int n = Convert.ToInt32(Console.Read());
            Console.ReadLine(n);

            string[] random = new string[n];
        }
    }
}

this is the basics I know that I need to use for it

d219
  • 2,707
  • 5
  • 31
  • 36
OTEN
  • 1
  • 1
  • 2
    Random between which boundaries? And, if you want random _numbers_, why is the array in your example a _strings_ array? – Nyerguds Apr 23 '20 at 12:27
  • See [System.Random](https://learn.microsoft.com/dotnet/api/system.random). But also make sure to read and fully understand: [Jon Skeet: Revisiting Randomness](https://codeblog.jonskeet.uk/2009/11/04/revisiting-randomness/) – Corak Apr 23 '20 at 12:28
  • 1
    And, a loop to fill up an array is an equally trivial matter. From your description this sounds like it could be a homework question, but if it is, you should really check your course material first. – Nyerguds Apr 23 '20 at 12:40

0 Answers0