Computer Science, asked by meenakshi16101982, 1 month ago

i=10
while i<20:
print(i*i)
i+=1

What is the output of the above program

Answers

Answered by anindyaadhikari13
42

\textsf{\large{\underline{Corrected C{o}de}:}}

i=10

while i<20:

   print(i*i)

   i+=1

\textsf{\large{\underline{O{u}tput}:}}

100

121

144

169

196

225

256

289

324

361

\textsf{\large{\underline{Explanation}:}}

  • 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 co‎de 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 MichMich0945
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