Create an algorithm for a program that draws a triangle usin

Create an algorithm for a program that draws a triangle using asterisks. Allow the user to enter the size of the triangle Make the height and the base the same size.

Here are some examples of how the output might look. You will need to do desk checks of your algorithm.

The user inputs a 5 for the size.

This program will build a triangle of the size you choose.
Please enter the size of the triangle.
5

* * * * *

* * * *

* * *

* *

*

or

*

* *

* * *

* * * *

* * * * *

or

*
* *
* * *
* * * *
* * * * *
Create an algorithm for a program that draws a triangle using asterisks. Allow the user to enter the size of the triangle Make the height and the base the same size. Here are Some examples of how the output might look. You will need to do desk checks of your algorithm. The user inputs a 5 for the size. This program will bild a triangle of the size you choose. Please enter the size of the triangle. or or

Solution

Pattern() { int i, j, rows Enter the number of rows scanf(\"%d\",&rows) for i=rows; i>=1; --i { for j=1; j<=i; ++j { Print(\"* \"); } printf(\"\ \"); } end }
Create an algorithm for a program that draws a triangle using asterisks. Allow the user to enter the size of the triangle Make the height and the base the same

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site