private void Display_Click(object sender, EventArgs e)
{
  int n = Convert.ToInt32(textBox1.Text, 10);
  int i, even, odd;
  odd = even = n;
  if (n % 2 == 0)
     odd = n - 1;
  else
     even = n - 1;
  listBox1.Items.Clear();
  listBox2.Items.Clear();
  for (i = 0; i <= even; i += 2)
     listBox1.Items.Add(i.ToString());
  for (i = odd; i >= 1; i -= 2)
     listBox2.Items.Add(i.ToString());
}
