Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class ConsoleTests
- {
- static void Main()
- {
- Console.Write("Number of random numbers: ");
- int counts = int.Parse(Console.ReadLine());
- Console.Write("From: ");
- int starting = int.Parse(Console.ReadLine());
- Console.Write("To: ");
- int ending = int.Parse(Console.ReadLine());
- Console.WriteLine();
- GenerateRandoms(counts,starting,ending);
- Console.WriteLine();
- }
- static void GenerateRandoms(int count, int start, int end)
- {
- Random rnd = new Random();
- for (int i = 1; i <= count; i++)
- {
- Console.Write("{0} ", rnd.Next(start, end+1));
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment