hello all,
I'm university student and i have final exam in c++ on monday very soon
so
i need some help
how to write a program in for loop the given output
Code:* *** ***** *******
this is what i tried
Quote:
int n =5;
for(int i=1; i<n+1 ;i++)
{cout << endl;
for(int j=1; j<i+1; j++)
cout << "*";
}
and the output came out like this
*
**
***
****
*****
but now i dont know how to make the first stars be in the middle of the line
what ways can i make it???
do i need to use a third for loop hope not for loops make my head hurts
thanks