Computer Science, asked by muthukrishnansowmaya, 3 months ago

9. LET SUM = O FOR I = 1 TO 5 LET SUM = SUM + I NEXT IPRINT SUM What will be the output
O a) 15
O b) 5
O c) 10
O d) 20​

Answers

Answered by anindyaadhikari13
3

Answer:

  • The output of the above códe is - 15.

Explanation:

  • Here, initial value of SUM is 0.
  • The value of SUM changes when the loop iterates.
  • We can see that the loop iterates in the range I = 1 to 5.
  • After each iteration, the value of I is added to SUM.
  • So, the value of SUM will be = 1+2+3+4+5 = 15
  • After termination of loop, the value of SUM is displayed on the screen.
  • So, 15 is the right answer (Option A).

•••♪

Similar questions