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
Hindi,
4 months ago
World Languages,
4 months ago
Math,
4 months ago
English,
8 months ago
Physics,
1 year ago