Tuesday, February 22, 2011

Write a Visual Basic Program for displaying all prime numbers below 10000

WAP for displaying all prime numbers .
______________________________________

Dim a

Private Sub clear_cmd_Click()
List1.Clear

End Sub

Private Sub exit_cmd_Click()
End
End Sub

Private Sub Form_Load()

End Sub

Private Sub generate_cmd_Click()
List1.Clear
a = Val(Text1.Text)
For i = 2 To a Step 1
For j = 2 To i Step 1
If i Mod j = 0 Then
GoTo S
ElseIf j + 1 = i Then
a = i
List1.AddItem (a)
End If
Next j
S:
Next i




End Sub


_______________________________________
OUTPUT
_______________________________________


____________________________________
DOWNLOAD
____________________________________

Download its form

Download its Image



No comments:

Post a Comment