CODE
private sub command1_click()
Dim a,b,c,d as Integer
b= val(text1.text)
a=b
c=0
while(b>0)
d=b mod 10
c=c+(d*d*d)
b=b/10
wend
if(a=c) then
Msgbox "Given number is an Armstrong Number"
else
MsgBox"Its Not an Armstrong Number"
endif
endsub
there is no error in this program. but it displays else part ie "ITS not an armstrong Number" for integer value and if "its an armstrong nummber" for an character.
why ?????????????
This post has been edited by jebastino: 11 Aug, 2009 - 12:39 AM