declare sub armstrong(n)
Cls
Input "Enter the number"; n
z = n
Call armstrong(n)
End
Sub armstrong (n)
z = n
While n <> 0
r = n Mod 10
s = s + r ^ 3
n = n \ 10
Wend
Print z
Print s
If z = s Then
Print "Number is armstrong"
Else
Print "Number is not armstrong"
End If
End Sub


0 Comments