HOW TO PRINT PATTERN LIKE THIS

Jeet Verma

Total Post:110

Points:776
Posted by  Jeet Verma
 880  View(s)
Ratings:
Rate this:
Hi,

I want to create following pattern in c++

*
**
***
****
*****

Thanks in advance. 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: How to print pattern like this

    Hi,


    try this:

    int main()
    {
       int i,j;
       for(i=0;i<5;i++)
       {
          for(j=0;j<=i;j++)
           {
             cout<<"*";
             cout<<" ";
           }
         cout<<"\n";
        }
    return 0;
      }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!