Question: Write a program that will ask the user to input an odd number in the range from 1 25. The program will then display a

Write a program that will ask the user to input an odd number in the range from 1 25. The program will then display a diamond containing that many rows of stars. (The sample at the left would be the output for 9 rows.) Hint: First, figure out the solution for the sample pattern (fixed value of 9 rows). Then, modify your program so that your user can input the number of rows in the diamond.

*

***

*****

*******

*********

*******

*****

***

*

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 Databases Questions!