Hi there.
I need help on getting the values of the 6 textbox's and find 3 lowest ones.
Thank you
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vimal KandasamyPosted Mar 26, 2009, 5:51 AM
you can store values of Textbox into array like
arr[0]=int.Parse(textBox1.Text);
etc
etc
then simply sort it... you will get lowest values in 1st three index of array...
following code will help you to sort.
for (int i = 0; i < arr.Length; i++)
{
for (int j = i + 1; j < arr.Length; j++)
{
if (arr[i] > arr[j])
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}