VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 307,154 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,613 people online right now. Registration is fast and FREE... Join Now!




simple program in VB

 

simple program in VB

jebastino

11 Aug, 2009 - 12:38 AM
Post #1

New D.I.C Head
*

Joined: 30 Jul, 2009
Posts: 5

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

User is offlineProfile CardPM
+Quote Post


Posts in this topic

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 05:17PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month