Question
Q1. Print a pyramid with stars. Prompt the user to enter the height of the pyramid in number of rows (1 to 10, including both)
Q1. Print a pyramid with stars. Prompt the user to enter the height of the pyramid in number of rows (1 to 10, including both) , or 0 to exit. Check the height entered - if 0 exit, while -ve or >10 - tell the user that height should be positive and not more than 10. Prompt for height again. If height positive and not more than 10 - Then print the pyramid with one star at the top followed by 3 on 2nd row and 5 on 3rd row etc - eg a pyramid of height 5 should look like - * *** ***** ******* *********
Please use c programming and the steps. thanks.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started