Prime Numbers between 1 - 100Prime Numbers between 1 - 100
Option Explicit
Private Sub cmdDisplay_Click()
Dim n As Integer
Dim i As Integer
Dim p As Byte
p = 1
For n = 2 To 100
For i = 2 To n \ 2
If n Mod i = 0 Then
p = 0
Exit For
Else
p = 1
End If
Next
If p = 1 Then
Print n
End If
Next
End Sub
Private Sub cmdDisplay_Click()
Dim n As Integer
Dim i As Integer
Dim p As Byte
p = 1
For n = 2 To 100
For i = 2 To n \ 2
If n Mod i = 0 Then
p = 0
Exit For
Else
p = 1
End If
Next
If p = 1 Then
Print n
End If
Next
End Sub
=================================Slip 1_2=================================
Create the following application in VB. The form should contain the following menu
Draw Modify Exit
Circle Shrink
Expand
Erase
========================================================================
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button AndvbRightButton Then
PopupMenumnuModify
End If
End Sub
Private Sub mnuCircle_Click()
Shape1.Visible = True
End Sub
Private Sub mnuErase_Click()
Shape1.Visible = False
Shape2.Visible = False
End Sub
Private Sub mnuExpand_Click()
Shape2.Visible = False
Shape1.Visible = True
End Sub
Private Sub mnuShrink_Click()
Shape2.Visible = True
Shape1.Visible = False
End Sub
VB 6.0 slip 1
Reviewed by Dinesh Varal
on
August 01, 2018
Rating:
Reviewed by Dinesh Varal
on
August 01, 2018
Rating:

No comments: