How would I use a FOR-NEXT loop to total numbers from 1 through 100?

1 answer

Answer

1041113

2026-03-22 08:45

+ Follow

To total numbers from 1 through 100 using a FOR-NEXT loop, you would initialize a variable to store the sum and then iterate through each number from 1 to 100. In each iteration, you would add the current number to the sum variable. Here's a simple pseudocode example:

<code>sum = 0

FOR i = 1 TO 100 sum = sum + i NEXT i

</code>

After the loop, the variable sum will contain the total of numbers from 1 to 100.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.