You are on page 1of 1

Continue

Break

Nested
private void button1_Click(object sender, EventArgs e)
{
string[] instructor = { "Efren", "Gilbert", "Velinda", "Doris", "Hevin"};
string[] subject = { "HCI", "Programming 2", "GIS", "ProfEt", "Software
Engineering"};
string name = textBox1.Text;
for (int x = 0; x < 5; x++)
{ if (name == instructor[x])
{ for (int y = 0; y < 5; y++)
{ if (x == y)
{ MessageBox.Show(subject[y]);
}
}
}

}}

You might also like