Dim m As IntegerDim n As IntegerDim R As Integerm = Val(Text1.Text)n = Val(Text2.Text)R = m Mod nDo While R <> 0 m = n n = R R = m Mod nLoopText3.Text = n