I am looking to print 20 random numbers. Is it possible to do this with a for
loop; and if it is, how can I do it?
Here is my current code:
int[] randomNum = new int[20];
Random RandomNumber = new Random();
for (int i = 0; i < 20; i++)
{
randomNum[i] = RandomNumber.Next(1, 80);
}
foreach (int j in randomNum)
{
Console.WriteLine("First Number:{0}", j);
Thread.Sleep(200);
}