Question: Write a program that prints out, on a single line separated by spaces and terminated with a newline, the first twenty perfect squares starting

Write a program that prints out, on a single line separated by

Write a program that prints out, on a single line separated by spaces and terminated with a newline, the first twenty perfect squares starting with 1. Don't square any numbers, but take advantage of the fact that the difference between 1 and 4 is 3, 4 and 9 is 5, 9 and 16 is 7, etc. So, you just need to start with 1 and then add on successive odd numbers starting with 3. To avoid advancing to the next line, use end="". You may also need to print a space"". You can print a newline by just calling print() with no arguments.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!