using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication8
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int i, a, b, top, j;
a = Convert.ToInt32(textBox1.Text);
b = Convert.ToInt32(textBox2.Text);
for (i = a; i <= b; i++)
{
top = 0;
for (j = 1; j <= i; j++)
if (i % j == 0)
top = top + 1;
if (top == 2)
listBox1.Items.Add(Convert.ToString(i));
}
}
}
}