Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,446 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,177 people online right now. Registration is fast and FREE... Join Now!




hello

 
Reply to this topicStart new topic

hello, vb code for generating armstrong number within the limit

sramya
23 Jul, 2008 - 01:31 PM
Post #1

New D.I.C Head
*

Joined: 22 Jul, 2008
Posts: 1


My Contributions
dim m,n,p,s,a,c,i as integer
private sub command1_click()
n=val(text1.text)
m=val(text2.text)
s=0
p=0
for i=n to m step 1
c=i
while(c>0)
a=c mod 10
p=a*a*a
s=s+p
wend
if(s=i) then
print i
end if
next i
end sub

i tried myself for armstrong generation-providing upperlimit and lowerlimit as input, and the armstrong numbers within the limit should display.but it's not been executed. can you help me please.
User is offlineProfile CardPM
+Quote Post

SpiderSpartan
RE: Hello
24 Jul, 2008 - 10:40 AM
Post #2

D.I.C Head
Group Icon

Joined: 6 Feb, 2008
Posts: 66



Thanked: 3 times
Dream Kudos: 25
My Contributions
have you tried stepping through the code to see what it's doing. The other thing I see here is "print i" I'd recommend setting some "text3.text = i" or "label1.caption = i"
User is offlineProfile CardPM
+Quote Post

Locke37
RE: Hello
24 Jul, 2008 - 10:57 AM
Post #3

I'm not a thief...I prefer the term TREASURE HUNTER!
Group Icon

Joined: 20 Mar, 2008
Posts: 1,005



Thanked: 39 times
Dream Kudos: 325
My Contributions
In the future...code.gif

However, all the cool people (smile.gif) use these tags...

[*code=vb]Paste your code between these tags[*/code] >>> NO *'s

This post has been edited by Locke37: 24 Jul, 2008 - 10:58 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 02:44PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month