Code:
Module Module1
Sub Main()
Dim num, i As Integer
Dim b As Boolean
Console.WriteLine(" Enter any Number= ")
num = Console.ReadLine()
i = 2
b = True
While i < num
If num Mod i = 0 Then
b = False
GoTo 25
End If
i = i + 1
End While
25:
If b Then
Console.WriteLine(" Prime Number ")
Else
Console.WriteLine(" Not a Prime Number ")
End If
Console.ReadKey()
End Sub
End Module
Module Module1
Sub Main()
Dim num, i As Integer
Dim b As Boolean
Console.WriteLine(" Enter any Number= ")
num = Console.ReadLine()
i = 2
b = True
While i < num
If num Mod i = 0 Then
b = False
GoTo 25
End If
i = i + 1
End While
25:
If b Then
Console.WriteLine(" Prime Number ")
Else
Console.WriteLine(" Not a Prime Number ")
End If
Console.ReadKey()
End Sub
End Module
Output: