Friday, 14 June 2013
Armstrong Number
Armstrong Number Code :-
Design Form like that :-
And write down that code :-
Private Sub Command1_Click()
Dim i, x, r, n As Integer
n = InputBox("enter the numnber")
x = n
i = 0
While (x > 0)
r = x Mod 10
i = i + r * r * r
x = Int(x / 10)
Wend
If n = i Then
Print "Armstrong"
Else
Print "not armstrong"
End If
End Sub
Subscribe to:
Posts (Atom)