I'm trying to find the maximum and minimum numbers out of 2 integers that a user has inputted. Firstly i have converted the string to int, then went to put them into an array so i can manipulate them. I think i'm getting stuck when it comes to assigning variables to an array. But i couldn't see any examples of arrays with variables assigned to them, which is probably where i'm going wrong.
private void button1_Click(object sender, EventArgs e)
{
string txtbxnum1 = Int32.Parse(num1);
string txtbxnum2 = Int32.Parse(num2);
int[] numbers = new int[2] {0,1};
int numbers [0] = num1;
int numbers [1] = num2;
int maximumNumber = Max.numbers();
int minimumNumber = Min.numbers();
MessageBox.Show (maximumNumber.Text);
}
I would be glad of any help or direction.
maximumNumber = Math.Max(txtbxnum1, txtbxnum2);