Write a program that asks the user to enter an integer


Program

Write a program that asks the user to enter an integer between 1 and 15. If the number entered is outside that range, your program should print out an error message and re-prompt for another number. (This is an opportunity to write an input validation loop.)

Once the user enters a number in the correct range, your program will print out four patterns of asterisks that look like the following. Note that the number provided by the user is equal to the height of the pattern.

Example- If the input value is 5, please print the following four patterns:

* * * * *

* * * *

* * *

* *

*

* * * * *

* * * *

* * *

* *

*

 

*

* * *

* * * * *

* * * * * * *

* * * * * * * * *

*

* *

* *

* *

* * * * * * * * *

As you can see, the input value represents the height of the triangle.

Your program should only print one asterisk at a time and use loops to control the number of asterisks printed per line.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a program that asks the user to enter an integer
Reference No:- TGS02899768

Expected delivery within 24 Hours