Question: I am writing a program to get input from the user to make a triangle. However, I now need to make the triangle hollow, so

 I am writing a program to get input from the user

to make a triangle. However, I now need to make the triangle

I am writing a program to get input from the user to make a triangle. However, I now need to make the triangle hollow, so it is just an outline, but I can't figure out how to edit my code to do so.

Here are the original instructions:

"Write a C++ program that gets two inputs an integer and a character. Use repetition control structures better known as "loops" to output an outline of a triangle shape composed of the character and the width specified by the integer. If the input is an even number, it should be increased to the next odd number."

Above is my code so far, which is just printing a solid triangle:

Can you help me edit this so that the triangle is hollow inside?

#include 3 #include 4 5 using namespace std; 7Variables 8 int length; 9 int i,j,k; 10 char symbol; 11 char no 12 char q; 13 14 int mainC 15 16 17 18 Get user inputs for triangle size cout base; base++ 20 21 //Get user inputs for symbol used to make triangle

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!