How to print pattern like this

Total Post:110

Points:776

 1225  View(s)
Ratings:
Rate this:
Hi,

I want to create following pattern in c++

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

Thanks in advance. 
  1. 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;
      }

      Modified On Mar-30-2018 03:54:34 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.