Please help me create the blocks of code that will calculate the sum of N natural numbers, where N is the user input between 1 and 20. For example, if the user input is 5, then the app will output the sum of the first 5 natural numbers (1+2+3+4+5) which is 15 and so forth. I know the “for each” number block is needed to write the loop, but im unsure of what else.
Thank you much!
If you want to impress your teacher, see
Hold the phone behind your head and do the multiplication in your head, pretending to do all that mentally.
2 Likes
with the new introduced "reduce list" block, we can do this:
2 Likes
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.