- Home
·
- Math/Dates
·
- to tell whether a number enterted by the user is prime or composite
to tell whether a number enterted by the user is prime or composite
to tell whether a number enterted by the user is prime or composite
Rate to tell whether a number enterted by the user is prime or composite
(1(1 Vote))
If a = 1 Then
MsgBox ("THe number entered by you is neither prime nor composite")
End If
For i = 2 To a - 1
If a Mod i = 0 Then
MsgBox ("The number entered by you is a composite number")
GoTo 0
End If
If a Mod i <> 0 Then
End If
Next i
If a <> 1 Then
MsgBox ("The number entered by you is a prime number")
End If
0 End Sub
to tell whether a number enterted by the user is prime or composite Comments
No comments yet — be the first to post one!
Post a Comment