i=10
while i<20:
print(i*i)
i+=1
What is the output of the above program
Answers
Answered by
42
i=10
while i<20:
print(i*i)
i+=1
100
121
144
169
196
225
256
289
324
361
- Line 1: The value of 'i' is is initialized with 10.
- Line 2: A looping construct is created that executes the statements repeatedly when i < 20.
- Line 3: The value of i² is displayed on the screen.
- Line 4: The value of 'i' is incremented by 1.
So, the given code displays the square of all the numbers from 10 to 19 in separate lines.
See attachment for verification.
Attachments:
anindyaadhikari13:
Thanks for the Brainliest :)
Answered by
5
Output:
100
121
144
169
196
225
256
289
324
361
Note: I used JavaScript to quickly do this thing but the output should be same in all languages.
Hope this helps you!
Similar questions