0
How do I print something like the one in the description using a loop.
# ## ### #### ##### ###### #######
6 Answers
+ 2
and if you want more or less than 7
int n;
cin>>n;
for(int i=1;n>=i;i++) {
for (int j = 1; i>=j; j++)
cout << "#";
cout<<endl;
}
+ 1
for(int i=0;i<7;i++)
{
for(int j=0;j<i+1;j++)
cout<<"#";
cout<<"/n";
}
I think this should work
+ 1
https://code.sololearn.com/cbk5Bx6ZNOLd/?ref=app
This is the link of where I tried
0
Using a single loop:-
string a;
for(int i = 0; cout << a << endl, i < 7 ; i++)
a.insert(a.size(), 1, '#');
0
Troll version:
for(int i=0;i==0;i++)
cout<<"#/n##/n###/n####/n#####/n######/n#######";
0
Thank you good people I can see where I was wrong.