My problem is, I've just started with C# and i was given a problem to solve by my teacher... here is the code...
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[20];
Random rand = new Random();
for (int i = 0; i < 10; i++) a[i] = rand.Next(10000);
for (int i = 0; i < 10; i++) Console.WriteLine(a[i]);
Console.Read();
}
}
}
Now i have to use a Loop to desplay the number from small to big. The way it is now is the numbers display random between 0-10000 and i was told that i need to add a loop/s to that code that display the unsorted number from min to max, in other words, sorted. both unsorted and sorted must be displayed in the console. I've been trying to figure this out for the past 6hours and no luck, not even on the internet. Please help!!!!