Page 1 of 1

FOR/NEXT program question

Posted: Fri Nov 02, 2012 11:25 pm
by JasonQuinn1992
Im working on two homework assignments at once my next assignment is to

Use a FOR/NEXT loop to total the numbers from 1 through 100. Print the numbers on the screen.

Here is what I have so far....

DIM X AS INTEGER

CLS

FROM X = 1 TO 100
RANDOMIZE TIMER
PRINT (RND * 100);
NEXT X


The program Im having when i try to run this program is that i get an "expected end-of-statement" error on "TO". Why would this be?

Posted: Sat Nov 03, 2012 11:56 am
by burger2227

Code: Select all

CLS 
RANDOMIZE TIMER 

FOR X = 1 TO 100 
PRINT (RND * 100); 
NEXT X 

Posted: Sun Nov 04, 2012 12:36 am
by JasonQuinn1992
I was able to figure that out and fix it! Thanks for the help!