Hello. So, I was wondering on how to program in a good start. I have made a "Hello, World!" example, but I think I need to learn more (I know how to use input, the ? command, the While command, Wend command, For, To, Next, etc.)
So pls give me examples and new programming guides
Help with programming.
Root / Programming Questions / [.]
the_squat1115Created:
Write me a program that sums up only the even numbers between 0 and 100.idk how to do it
The you don't know your FOR loops as well as you think you do.
VAR SUM=0,I FOR I=0 TO 100 STEP 2 INC SUM, I NEXT I PRINT SUMThe STEP instruction forces the FOR loop to proceed by 2 instead of 1 (well, by the number after STEP, in this case, 2). So, starting at 0, the loop will hit all the even numbers between 0 and 100 and they will be added into SUM.
The you don't know your FOR loops as well as you think you do.Thanks! EDIT: I know how to use FOR and TO, only for loading map loops without labels EDIT 2: It only displays the number 2550.VAR SUM=0,I FOR I=0 TO 100 STEP 2 INC SUM, I NEXT I PRINT SUMThe STEP instruction forces the FOR loop to proceed by 2 instead of 1. So, starting at 0, the loop will hit all the even numbers between 0 and 100 and they will be added into SUM.
With that knowledge, can you write me some code that adds up all the ODD numbers between 0 and 100? (Believe it or not, this sort of stuff is very much needed throughout common programs, which is why the STEP instruction exists!)I don't know what are you trying to mean about
1+3+5+7+9... But in the form of a FOR loop.Same... (I have started recently to use FOR, I have forgot to mention that)
I'm just trying to give you something like a programming challenge to help teach, but to be honest I'm not a good teacher lolOh, ok then