Computer Science, asked by pranjulgupta, 1 year ago

generate the pattern in c++ programming *

Answers

Answered by sahib12
1
click on this picture you will get an answer
Attachments:

pranjulgupta: can you help.me to generate some series
pranjulgupta: actually tomorrow i have an test
Answered by siddhartharao77
0
#include <iostream>

using namespace std;

int main()
{   
     int a, b,i,k;

    cout <<"Enter rows: ";

    cin >> b;

    for(i = 1, k = 0; i <= b; ++i, k = 0) 
   {
        for(a = 1; a<= b-i; ++a) 
      {
            cout <<"  ";       
    }
        while(k != 2*i-1)     
    {           
       cout << "* ";     
       ++k;       
 }

        cout << endl;   
 }    

    return 0;
}


Hope this helps!
Similar questions