However, the code i have so far come up with is not working and i cannot understand why, as i am not very experianced.
I suspect it has something to do with the int() part, as this is where the code hangs, but only on the second run through the loop.
Code: Select all
Dim currentValue As Integer = 2
Dim DivideBy As Integer = 1
Dim prime As Boolean = True
Do Until currentValue > 9999999
DivideBy = currentValue - 1
prime = True
Do Until DivideBy = 1 Or prime = False
If currentValue / DivideBy = Int(currentValue / DivideBy) Then
prime = False
If prime = True Then
currentValue = currentValue + 1