here is the example:

i use some for loop to search the number
and it can show me which number is prime number or not
but i don't know how to put my prime number into the list
here is what i can get so far.

can anyone help me? Thanks a lot
here are my code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a As Double Dim b As Double Dim c As Double a = Val(TextBox1.Text) b = Val(TextBox2.Text) For a = a To b Step 1 For c = 2 To a - 1 Step 1 If a Mod c = 0 Then Exit For End If Next ListBox1.Items.Addİ Next End Sub
can anyone tell me how to fix it?
This post has been edited by jayman9: 10 November 2007 - 02:57 PM

New Topic/Question
Reply




MultiQuote



|