You are on page 1of 2

Public Class Form1

Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim f As Integer
Dim m As Integer
Dim n As Integer
Dim x As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text
d = TextBox4.Text
f = TextBox5.Text
x=0
For i = 1 To 2000
m=i
If (m Mod a = 0) Then
If (m Mod b = 0) Then
If (m Mod f = 0) Then
If (m Mod c = 0) Then
If (m Mod d = 0) Then
x=x+1
If x = 1 Then
ListBox1.Items.Add(m)
End If
End If
End If
End If
End If
End If
Next
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
ListBox1.Items.Clear()
ListBox2.Items.Clear()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If MsgBox("desea salir", vbQuestion + vbYesNo, "salir") = vbYes Then
End
End If
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text
d = TextBox4.Text
f = TextBox5.Text
x=0
For i = 200 To 1 Step -1
If (a Mod i = 0) Then
If (b Mod i = 0) Then
If (c Mod i = 0) Then
If (d Mod i = 0) Then
If (f Mod i = 0) Then
x=x+1
If x = 1 Then
ListBox2.Items.Add(i)
End If
End If
End If
End If
End If
End If
Next
End Sub
End Class

You might also like