You just need to gather all random numbers to select the minimum and maximum from them. also you are using Console Application and the MessageBox
probably used in Windows Forms but if you want to use it in Console Application you need to import the using System.Windows.Forms;
library to use it just by Select:
Project->Add Reference
From the left side Select
FrameWork
and then choose
System.Windows.Forms
and then at the beginning of your code write:
using System.Windows.Forms;
Finally click
OK
and then your code in the Main:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
namespace MyProgram
{
class Program
{
static void Main(string[] args)
{
Random random = new Random();
List<int> randomNumbers= new List<int>();
for (int i = 0; i < 11; i++)
{
randomNumbers.Add(random.Next(1000));
}
MessageBox.Show(string.Format("The minimum is: {0}\nThe maximum is: {1}", randomNumbers.Min(), randomNumbers.Max()), "Result");
}
}
}