- Private Sub Command1_Click()
-
- Dim r As Long
-
- Dim a, b, c As Long
-
- a = Val(Text1.Text)
-
- b = Val(Text2.Text)
- If a > 2147483647 Or b > 2147483647 Then
- MsgBox ("Entrez une valeur pour a et une valeur pour b inférieur à 2147483647")
- Else
-
- If Text1.Text = "" Or Text2.Text = "" Then
- MsgBox ("Entrez une valeur pour a et une valeur pour b")
- Else
-
-
- If a = 0 And b = 0 Then
- MsgBox ("Le plus grand diviseur de 0 et 0 est infinie.")
- Else
-
- If b = 0 Then
- Text3.Text = a
- Text4.Text = 0
- Text5.Text = 1
- Text6.Text = 0
- Else
- r = a Mod b
- If r = 0 Then
- Text3.Text = b
- Text4.Text = a
- Text5.Text = a / b
- Text6.Text = 1
- Else
-
- While r <> 0
- a = b
- b = r
- r = a Mod b
- Wend
- r = 0
- Text3.Text = b
- Text4.Text = (Text1.Text * Text2.Text) / Text3.Text
- Text5.Text = Text1.Text / Text3.Text
- Text6.Text = Text2.Text / Text3.Text
- End If
-
- End If
- End If
-
- End If
-
- End If
- End Sub
-
- Private Sub Command2_Click()
- End
- End Sub
-
Private Sub Command1_Click()
Dim r As Long
Dim a, b, c As Long
a = Val(Text1.Text)
b = Val(Text2.Text)
If a > 2147483647 Or b > 2147483647 Then
MsgBox ("Entrez une valeur pour a et une valeur pour b inférieur à 2147483647")
Else
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox ("Entrez une valeur pour a et une valeur pour b")
Else
If a = 0 And b = 0 Then
MsgBox ("Le plus grand diviseur de 0 et 0 est infinie.")
Else
If b = 0 Then
Text3.Text = a
Text4.Text = 0
Text5.Text = 1
Text6.Text = 0
Else
r = a Mod b
If r = 0 Then
Text3.Text = b
Text4.Text = a
Text5.Text = a / b
Text6.Text = 1
Else
While r <> 0
a = b
b = r
r = a Mod b
Wend
r = 0
Text3.Text = b
Text4.Text = (Text1.Text * Text2.Text) / Text3.Text
Text5.Text = Text1.Text / Text3.Text
Text6.Text = Text2.Text / Text3.Text
End If
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub