How would you modify the BASIC code provided to...
How would you modify the BASIC code provided to calculate the sum of the first 100 integers if you wanted to calculate the sum of the first 200 integers instead?
Loading lesson…
To calculate the sum of the first 200 integers in BASIC, you would modify the loop to iterate from 1 to 200 instead of 1 to 100. Here is the modification:
BASIC Copy code
total = 0
FOR i = 1 TO 200
total = total + i
NEXT i
PRINT "Sum of first 200 integers is: "; total