I'm supposed to make this:
*
**
***
**** <---With this line being the input number by the user.
***
**
*
How do I do this using for loops in C++?
something like...
int main()
{
int n;
int k;
cout<<"Enter n:";
cin>>n;
for(k=1; k<=n; k++) <---Is this right
{
for(what goes here
{
for(what goes here
{
cout<<"*"<<" "; \<---Is this right?
}
}
}
cout<
return 0;
}
Am I missing anything else?
2007-02-05
08:19:40
·
3 answers
·
asked by
?
2
in
Computers & Internet
➔ Programming & Design
It didn't format right on this webpage its supposed to be:
*
**
***
****
*****
******
|*****
||****
|||***
||||**
|||||*
Where | = space
2007-02-05
09:17:41 ·
update #1