Professional Documents
Culture Documents
• Op 2: Same
• Op 3: Differ by 50
• Op 4: Differ by 160
Ans : Op 1: Differ by 80
3. Smriti wants to make a program to print the sum of square of the first 5
whole numbers (0...4). She writes the following program: integer i = 0 //
statement 1
integer sum = 0 // statement 2
while ( i < 5 ) // statement 3
{ sum = i*i // statement 4
i = i + 1 // statement
}
print sum // statement 6
Is her program correct? If not, which statement will you modify to correct
it?