Hello!
I have a problem with my code. I don't know how to make that the code will include a subroutine which returns a random number between the two entered numbers as a result. Do anyone know how to make it?
The code is:
static void Main(string[] args)
{
Console.Write("Enter the first number: ");
int num1 = int.Parse(Console.ReadLine());
Console.Write("Enter the second number: ");
int num2 = int.Parse(Console.ReadLine());
for (int i = 0; i < 100; i++)
{
Random rand = new Random();
int randomNumber = rand.Next(num1, num2);
Console.WriteLine("The random number is: {0}", randomNumber);
Console.ReadKey();
}
}