answersLogoWhite

0

Private Sub Check_Click()

Dim d As Integer

Dim num As Integer

Dim s As Integer

Dim old As Integer

num = Val(Text1.Text)

old = num

s = 0

While num > 0

d = num Mod 10

s = s + (d * d * d)

num = num \ 10

Wend

If old = s Then

Label1.Caption = "Armstrong"

Else

Label1.Caption = "Not armstrong"

End If

End Sub

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
ReneRene
Change my mind. I dare you.
Chat with Rene
EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra

Add your answer:

Earn +20 pts
Q: Write a VB program in to find number is Armstrong or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp