Which of the following flow charts will be most appropriate for finding sum of first 10 multiples of 5?
AS=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: S=S+I → I=I+5 → back to the decision.
BS=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: I=I+5 → S=S+I → back to the decision.
CI=1 → S=0 → decision 'IS I<=10?' — NO: PRINT S; YES: S=S+5*I → I=I+5 → back to the decision.
DS=0 → I=1 → decision 'IS I<=10?' — NO: PRINT S; YES: I=I+1 → S=S+5*I → back to the decision.
Show answerHide answer
Correct answer: (A) S=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: S=S+I → I=I+5 → back to the decision.
Explanation
The first 10 multiples of 5 are 5 to 50. Flowchart A starts at I = 5, adds I to S and then increases I by 5 while I ≤ 50. B increases I before adding, so it sums 10 to 55.