generate the pattern in c++ programming *
Answers
Answered by
1
click on this picture you will get an answer
Attachments:
pranjulgupta:
can you help.me to generate some series
Answered by
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!
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