VBI 17.PNG

Private Sub Command1_Click()
Dim n, s, r As Integer
n = Val(Text1.Text)
Do
    r = Int(n Mod 10)
    s = s + r
    n = Int(n / 10)
Loop While n > 0
Text2.Text = s
End Sub

VBO 17.PNG

Advertisements