0
thier is wrong things in this code l could not find it
#include<iostream> using namespace std; int main() { int e=9; cout<<"\"Upside Down Triangle\":\n\n"; for(int a=1;a<=5;a++) { for(int b=0;b<e;b++) { cout<<"*"; } cout<<endl; e=e-2; for(int c=0;c<a;c++) { cout<<" "; } } return 0; }
7 Antworten
+ 1
When you keep e=e-2 you'll get the output as..
*********
*******
*****
***
*
If you remove it you'll get the output as
***********
************
**************
****************
******************
+ 1
your code seem correct, but I made some modifications to adapt it to any input, not 9 only!
https://code.sololearn.com/c1Ein4kkbWYw/?ref=app
0
What output do you want?
According to your logic it's right I think!! 🤔 No errors
If you mention your output then I can try.. But one thing, instead of \n you can have endl in cpp..
0
***********
************
**************
****************
******************
the output be like this
0
Then remove e=e-2 and check it once
0
I want the output be like this
*********
*******
*****
***
*
0
ok thx