Prime Or Not Prime Number Code in Console Application on VB
#CODING HERE...
Module Module1
Sub Main()
Dim i, j,
x, y As Integer
System.Console.WriteLine("Enter No:")
x =
System.Console.ReadLine
j = 1
While (j
<= x)
If (x
Mod j = 0) Then
y =
y + 1
End If
j = j +
1
If (y =
2) Then
System.Console.WriteLine("No Is Prime")
Else
System.Console.WriteLine("No Is Not Prime")
End If
System.Console.Read()
End While
End Sub
End Module
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment