Sharmili wants to make a program to print the sum of all perfect cubes, where the value of the cubes go from 0 to 100. She writes the following program:

integer i = 0, a; // statement 1

integer sum = 0;

a = ( i * i * i )

while ( i < 100 ) // statement 2

{

sum = sum + a // statement 3

i = i + 1

a = ( i * i * i ) // statement 4

}

print sum

Does this program have an error? If yes, which one statement will you modify to correct the program?

1
Statement 1
2
Statement 2
3
Statement 3
4
Statement 4

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation