Code: Select all
Dim intNumber As Integer
Dim intCouting As Integer
Dim bool As Boolean
Dim strings As String
intNumber = Val(TextBox1.Text)
If intNumber < 0 Then
MessageBox.Show("Please Insert A Positive Integer")
TextBox1.Text = Nothing
bool = False
End If
For intcounting = 2 To intNumber Step 1
If intNumber Mod intcounting <> 0 Then
bool = False
Else
bool = True
End If
Next intcounting
If bool = True Then
RichTextBox1.Text = Nothing
RichTextBox1.Text = "prime"
ElseIf bool = False Then
RichTextBox1.Text = Nothing
RichTextBox1.Text = "notprime"
End If