private void fillButton_Click(object sender, EventArgs e) { int k = (int)numericUpDown1.Value; double[] myArray = new double[k]; myArray = task1.CreateArray(myArray.Length); for (int i = 0; i < myArray.Length; i++) { textBox1.Text += $"{myArray[i]:f3}\t"; } double max = task1.Max(myArray); maxTextBox.Text = $"{max:f3}"; }