C# Triangle of stars | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

C# Triangle of stars

I am trying to write a code that prints a triangle with "*" that is empty inside and my code kinda prints something but apparently i made a mistake somewhere, I'd appreciate if anyone could help me with this https://code.sololearn.com/c9p197iCvawJ/?ref=app

31st Oct 2018, 4:45 PM
Sajad B.
9 Answers
+ 4
You only need to change line 30, from B =" "; into B =" "; you used one space pad there, make it two spaces and it's fine : )
31st Oct 2018, 6:09 PM
Ipang
+ 4
No problem mate : )
31st Oct 2018, 8:35 PM
Ipang
+ 4
Good job 👍
2nd Nov 2018, 9:03 AM
Ipang
+ 3
Ipang thanks for your help.
31st Oct 2018, 8:21 PM
Sajad B.
+ 2
Ipang I'm trying to make it symmetrical but it doesn't work for half of it🤔, can you take a look?
2nd Nov 2018, 8:33 AM
Sajad B.
+ 2
Not too sure what your goal is, by symmetrical did you mean a pyramid like shape or something else?
2nd Nov 2018, 8:38 AM
Ipang
+ 2
Ipang kind of an equilateral triangle
2nd Nov 2018, 8:42 AM
Sajad B.
+ 2
Ipang ok, i fixed the issue myself, i thought i could decrement n inside the for loop parentheses but that's wrong. just took that out and it works now.
2nd Nov 2018, 8:58 AM
Sajad B.
0
okay i guss
2nd Nov 2018, 2:07 PM
Groovy Grover
Groovy Grover - avatar