Today, 01:52 AM
This is about as simple as it gets:
A sieve generator:
A brute force generator:
A sieve generator:
Code: (Select All)
Print "Enter array size";: Input m
d = m ^ 2
ReDim p(d) As _Byte
For x = 2 To m
For l = x + x To d Step x
If l <= d Then
p(l) = -1
End If
Next
Next
For x = 2 To d
If p(x) = 0 Then Print x;
Next
End
Code: (Select All)
Print "Enter upper range";: Input d
For l = 2 To d
f = 0
For m = 2 To Int(Sqr(l))
If l Mod m = 0 Then f = -1: Exit For
Next
If f = 0 Then Print l;
Next
End