URGENT!! – C++ Programming help . Need a code for the following question.?

Question by Rick D: URGENT!! – C++ Programming help . Need a code for the following question.?
Write a program that reads in the desired size of the triangle and prints a hollow triangle of that size using asterisks and spaces. Your program must determine whether to print an asterisk (*) or space ( ) at each location. Keep in mind that, when using the command window, the output will always be displayed from left to right, top to bottom. Your program should only accept even side lengths between 2 and 20 (inclusive). For example, if your program reads in a size of 6, the following output should be displayed:
*
**
*-*
*–*
*—*
******
where “-” should be space
NOTE: You may only use two while loops, one embedded (nested) in the other, and one if…else statement to draw the triangle.

NEED IT BY FRIDAY PLEASE HELP!!!!

If you don’t want to write the whole code just give me a rough idea to start with. PLEASE!!!

Best answer:

Answer by AnalProgrammer
Everyone wants to draw bloody tiangles or pyramids with asterisks.
This is not difficult. Have you at least attempted to do this or do you not care about this course?

for (i=0;i

Know better? Leave your own answer in the comments!

Leave a Reply

Your email address will not be published. Required fields are marked *


*