Eliminate Print x+5 just print x.
Eliminate x=x as x will always equal x
------------------
Announcement
Collapse
No announcement yet.
Summing Numbers
Collapse
X
-
Code:x = x
MCM
Leave a comment:
-
Keith, by now you may be smacking your head against a wall and going dooh!
Nevertheless, your problem is that you are incrementing the value of x by 5 before printing it. Just "Print x" instead of "Print x+5"and it will be fine.
------------------
[email protected]ems6.gov.bc.ca
Leave a comment:
-
Keith,
What you are asking for and the information supplied in your "non-working"
demo contradict each other.
In english (not code or psuedo code) describe what your are
trying to do and we'll work from there.
------------------
Every day I try to learn one thing new,
but new things to learn are increasing exponentially.
At this rate I’m becoming an idiot faster and faster !!!
------------------
George W. Bleck
Lead Computer Systems Engineer
KeySpan Corporation
Leave a comment:
-
Summing Numbers
Can anyone tell me why this doesn't sum numbers or tell me of a better way to do it.
x = x
for T = 1 to 8
x= x +5
print x +5
delay 1
x = x
next T
it seems that the numbers should be 5,10,15,20,25,30,35,40.
print "The total for the 5 numbers should be ";x (40).
My problem is, when I get to the "x" above, the numbers are not added together.
My goal is to write a routine to sum several numbers. And at the end,
I've been struggling with this for 3 hours and could not get it to work.
------------------
Tags: None
Leave a comment: