I wrote a simple VB code, try to guess what the program does
Private Sub cmd1_Click()
Dim a As Integer
Dim i As Integer
If txt2 = "" Then
MsgBox ("Error 1")
ElseIf txt1 = "" Then
MsgBox ("Error 2")
ElseIf txt2 <= 1 Then
MsgBox ("Error 3")
ElseIf txt2 > 10 Then
MsgBox ("Error 4")
ElseIf Int(txt2) <> txt2 Then
MsgBox ("Error 5")
Else
a = txt2
b = txt1
i = 0
c = 0
While (a ^ i) <= b
i = i + 1
Wend
i = i - 1
While i >= -15
d = Int(b / (a ^ i))
c = c + d * (10 ^ i)
b = b - d * (a ^ i)
i = i - 1
Wend
lbl1 = c
End If
End Sub
Private Sub cmd1_Click() Dim a As Integer Dim i As Integer If txt2 = "" Then MsgBox ("Error 1") ElseIf txt1 = "" Then MsgBox ("Error 2") ElseIf txt2 <= 1 Then MsgBox ("Error 3") ElseIf txt2 > 10 Then MsgBox ("Error 4") ElseIf Int(txt2) <> txt2 Then MsgBox ("Error 5") Else a = txt2 b = txt1 i = 0 c = 0 While (a ^ i) <= b i = i + 1 Wend i = i - 1 While i >= -15 d = Int(b / (a ^ i)) c = c + d * (10 ^ i) b = b - d * (a ^ i) i = i - 1 Wend lbl1 = c End If End Sub