Function Prime(ByVal InputNumber As Integer) As Integer
Dim i, j As Integer
i = 1
j = 0
While i <= InputNumber
If InputNumber Mod i = 0 Then j = j + 1
i = i + 1
End While
If j = 2 Then
Console.WriteLine("Number is Prime")
Else
Console.WriteLine("Not Prime")
End If
Console.WriteLine("Press Any Key to Exit")
Console.ReadKey()
End Function
Learn VB.Net Programming
Tuesday, January 4, 2011
Subscribe to:
Posts (Atom)