I can do the pattern totally for * or number only but how to use both together for pattern?
Here is the pattern i want to do.
0
* *
0 1 2
* * * *
0 1 2 3 4
* * * *
* * *
* *
*
#include <iostream>
using namespace std;
int main()
{
for (int a=1; a<=5; a++)
{
for (int b=1; b<=a; b++)
{
for (int i=0; i<b; i++)
{
cout<<i<<" ";
}
cout<<endl;
}
for (int b=1; b<=a; b++)
{
for (int i=0; i<b; i++)
{
cout<<"* ";
}
cout<<endl;
}
}
for (int c=1; c<=4; c++)
{
for (int d=4; d>=c; d--)
{
cout<<"* ";
}
cout<<endl;
}
system ("pause");
return 0;
}