Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim PNum As Integer
- Dim DivNum As Integer
- Dim Remainder As Single
- Dim PrimeFlag As String = " Y "
- For PNum = 2 To 5000
- PrimeFlag = "Y"
- For DivNum = 2 To PNum - 1
- Remainder = PNum Mod DivNum
- If Remainder = 0 Then
- PrimeFlag = "N"
- End If
- Next
- If PrimeFlag = "Y" Then
- TextBox1.Text = TextBox1.Text & PNum & " "
- End If
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement