Question:

How to create a triangle pattern of "*" using a For loop in C++?

by  |  earlier

0 LIKES UnLike



The following 2 code fragments displays the above pattern. I want to display this same pattern using a For loop in C++.

cout<<"\t";

cout<<"*";

cout<<endl;

cout<<"\t\b***";

cout<<endl;

cout<<"\t\b\b*****";

cout<<endl;

cout<<"\t\b\b\b*******";

cout<<" * "<<endl;

cout<<" *** "<<endl;

cout<<" ***** "<<endl;

cout<<" ******* "<<endl;

cout<<" ********* "<<endl;

I'm a newbie in C++. Help needed

 Tags:

   Report

2 ANSWERS


  1. How to Print the


    1


    23


    345


    4567


  2.  how to display triangle like this?


                      *


                    **


                  ***


                ****


              *****

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions