write a C++ program which implements both the while and for loop, as needed, to
ID: 3641470 • Letter: W
Question
write a C++ program which implements both the while and for loop, as needed, to draw the illustrations given below. The number of rows or columns are determined by the type of figure and the value of n, which will be provided by the user.1. An upside-down triangle drawn using the digits as shown below. For instance for n = 8, your program will draw this triangle. (n is between 1-9).
12345678
1234567
123456
12345
1234
123
12
1
2. An equilateral triangle drawn using the character '*'. For instance,
for n = 6, your program will draw this triangle.
* * * * * *
* * * * *
* * * *
* * *
* *
*
Explanation / Answer
1) Answer for the first question: #include using namespace std; void main() { for(int i=0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.