quinta-feira, 28 de outubro de 2010

ficha de trabalho numero 8 exercicio 2

Private Sub Command1_Click()
Dim num1 As Integer, num2 As Integer, cont As Integer, div As Integer
num1 = Val(Text1.Text)
num2 = Val(Text2.Text)
Do
div = 0
cont = 1
Do While cont <= num1
If num1 Mod cont = 0 Then
div = div + 1
End If
cont = cont + 1
Loop
If div = 2 Then
Picture1.Print num1
End If
num1 = num1 + 1
Loop While num1 <= num2
End Sub

Private Sub Command2_Click()
If MsgBox("Quer mesmo sair?", vbOKCancel + vbQuestion, "Confirmação!") = vbOK Then
End If
End
End Sub

Sem comentários:

Enviar um comentário