Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Dim PNum As Integer
  2. Dim DivNum As Integer
  3. Dim Remainder As Single
  4. Dim PrimeFlag As String = " Y "
  5. For PNum = 2 To 5000
  6. PrimeFlag = "Y"
  7. For DivNum = 2 To PNum - 1
  8. Remainder = PNum Mod DivNum
  9. If Remainder = 0 Then
  10. PrimeFlag = "N"
  11. End If
  12. Next
  13. If PrimeFlag = "Y" Then
  14. TextBox1.Text = TextBox1.Text & PNum & " "
  15. End If
  16. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement