Tuesday, June 30, 2009

To determine prime number

Function determinePrime(ByVal x As Integer) As Boolean
For a = 2 To x / 2
If x Mod a = 0 Then
Return False
End If
Next
Return True
End Function

No comments: