Question

Write a program that prints every integer value from 1 to 20 along with the squared...

Write a program that prints every integer value from 1 to 20 along with the squared value of each integer.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

program in python.

for i in range(1,21):

    print(i,i*i)

    

output:

1 1

2 4

3 9

4 16

5 25

6 36

7 49

8 64

9 81

10 100

11 121

12 144

13 169

14 196

15 225

16 256

17 289

18 324

19 361

20 400

>>>

range(1,21) --- range is from 1 to 20 , 21 is ignored

In first iteration the 1 goes to i

In second iteration the 2 goes to i

Add a comment
Know the answer?
Add Answer to:
Write a program that prints every integer value from 1 to 20 along with the squared...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT