- #1
ranger
Gold Member
- 1,687
- 2
I need some help. So far I have some for loops that print the following patters:
*
**
***
****
*****
******
*******
********
*********
**********
and **********
*********
********
*******
******
*****
****
***
**
*
Here is the code:
The first pair of for loops prints the first pattern and the second prints the second pattern. I need some help with a third pattern though. It should look smoething like this:
**********
*********
********
*******
******
*****
****
***
**
*
EDIT: It seems the third pattern is not posting the way I typed it. So I have uploaded a MS Word file containg it.
--thank you.
*
**
***
****
*****
******
*******
********
*********
**********
and **********
*********
********
*******
******
*****
****
***
**
*
Here is the code:
Code:
for(int rows=1;rows<=10;rows++)
{
for(int asteriskcount=0;asteriskcount<rows;asteriskcount++)
{
cout<<"*";
}
cout<<endl;
}
cout<<endl<<endl;
for(int rows_2=1;rows_2<=10;rows_2++)
{
for(int asteriskcount_2=11;asteriskcount_2>rows_2;asteriskcount_2--)
{
cout<<"*";
}
cout<<endl;
}
cout<<endl<<endl;
The first pair of for loops prints the first pattern and the second prints the second pattern. I need some help with a third pattern though. It should look smoething like this:
**********
*********
********
*******
******
*****
****
***
**
*
EDIT: It seems the third pattern is not posting the way I typed it. So I have uploaded a MS Word file containg it.
--thank you.
Attachments
Last edited: