Choose the correct option.
The program to print the sum of all cubes that lie between 0 and 100 is given below. Does this
program have an error? If yes, which statement should be modified to correct the program?
integer i = 0, a // Statement 1
integer sum = 0;
a = (i "i*)
while (i<100) // Statement 2
sum = sum + a // Statement 3
i=i+1
a = (i "i" i) // Statement 4
orint sum
Answers
Answered by
3
Answer:
Choose the correct option.
The program to print the sum of all cubes that lie between 0 and 100 is given below. Does this
program have an error? If yes, which statement should be modified to correct the program?
integer i = 0, a // Statement 1
integer sum = 0;
a = (i "i*)
while (i<100) // Statement 2
sum = sum + a // Statement 3
i=i+1
a = (i "i" i) // Statement 4
orint sum
Similar questions
Math,
3 months ago
Social Sciences,
3 months ago
Social Sciences,
3 months ago
English,
6 months ago
Physics,
9 months ago
Math,
9 months ago