To start this is a homework assignment and I'm having a bit of trouble and would like some suggestions. So far I've created this application to take 10 inputted values from a user and store them into an array. I pass the array to the SmallAndLarge method where it displays derermines the smallest and largest of the 10 values using Sort() but now i have to display the smallest and largest of the 10 values the user entered and am having a trouble. Any help at all would be great!!
Also one other problem ive noticed that if the values 1 through 10 are entered 10 will be before 2 and after one when the array is sorted and displayed. Why is this?
namespace SmallAndLarge
{
class Program
{
static void Main()
{
int found = 0;
string[] numbers = new string[10];
for (int i = 0; i < numbers.Length; i++)
{
Console.Write("Enter ten numbers --> ");
numbers[i] = Console.ReadLine();
}
SmallestAndLargest(numbers);
}
public static int SmallestAndLargest(string[] numbers1)
{
int x;
Array.Sort(numbers1);
for (x = 0; x < numbers1.Length; ++x)
Console.Write("{0} ", numbers1[x]);
return x;
}
}
}