Hi, im confuse making this program,.. i need a little help from expert here in dream in code so i decided to post it in here,..
Write a program that uses for statements to print the following patterns separately, one below the other. Use for loops to generate the patterns. All asterisks (*) should be printed by a single statement of the form cout << '*'; (this causes the asterisks to print side by side). [Hint: The last two patterns require that each line begin with an appropriate number of blanks. Extra credit: Combine your code from the four separate problems into a single program that prints all four patterns side by side by making clever use of nested for loops.]
1.
*
**
***
****
*****
******
*******
********
*********
**********
2.
**********
*********
********
*******
******
*****
****
***
**
*
3.
**********
..*********
....********
......*******
........******
......... *****
............****
..............***
................**
..................*
4.
...................*
.................**
...............***
.............****
...........*****
.........******
.......*******
.....********
...*********
.**********
I already made 1 and 2 .. my problem is figure number 3 and 4, please help me using c++..(nevermind the dots in 3 and 4)
Here is the code i made so far in 1 and 2, i need 3 and 4 thanks i really appreciate your help...
CODE
#include<iostream>
using namespace std;
int main()
{
int value = 11;
for(int i = (value - 1); i > 0; i--)
{
for(int j = 0; j < i; j++)
cout << "*" << flush;
cout << "" << endl;
}
return 0;
}
A little help is a million thanks.....