Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Prime As String
For i As Integer = 0 To 100000000
If Primecheck(i) Then Prime = i
Next
MsgBox(Prime, 1001)
End Sub
Private Function Primecheck(ByVal N As Integer) As Boolean
For i As Integer = 2 To N - 1
If N Mod i = 0 Then Return False
Next
Return True
End Function
End Class
I was just wondering if there was any way to just display the 1001st value in the variable "Prime"?
If not would anyone be able to tell me of any other ways to achieve the 1001st prime number?
Many Thanks

New Topic/Question
Reply



MultiQuote







|