– Shashi wants to make a program to print the sum of the first 10 multiples of5.She writes the following program, where statement 5 is missing:integer i = 0integer sum = 0 while ( i <= 50 ) { sum = sum + i — MISSING STATEMENT 5 — } print sum Which of the following will you use for statement 5?
A. i = 5
B. i = 5 * i
C. i = i + 1
D. i = i + 5
Answer:D
– Shashi wants to make a program to print the sum of the first 10 multiples of5.She writes the following program, where statement 5 is missing:integer i = 0integer sum = 0 while ( i <= 50 ) { sum = sum + i — MISSING STATEMENT 5 — } print sum Which of the following will you use for statement 5?
A. i = 5 B. i = 5 * i C. i = i + 1 D. i = i + 5
Explanation: Multiple of 5will be 5,10(5+5),15(10+5)..