Question on: SS3 ICT - Basic Programming IV
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?
View related lesson
Ask EduPadi AI for a detailed answer
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
Add your answer
Please share this, thanks!
No responses