VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



to tell whether a number enterted by the user is prime or composite

by Sachin Tiwari (3 Submissions)
Category: Math/Dates
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Sat 2nd June 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



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

Download this snippet    Add to My Saved Code

to tell whether a number enterted by the user is prime or composite Comments

No comments have been posted about to tell whether a number enterted by the user is prime or composite. Why not be the first to post a comment about to tell whether a number enterted by the user is prime or composite.

Post your comment

Subject:
Message:
0/1000 characters