0
For loop in C#, C sharp
HOW TO DRAW THIS PATTERN WITH WRITE(“*”), WRITE(“-“), AND WRITELINE ****** ****- ***— **—- *—— ——- SO I HAVE THIS CODE static void DrawStarAndMinus(int n) { for (int i=1; i<=n; i++) { for (int j=i; j<=n; j++) { Console.Write("*"); Console.Write("-“) Console.WriteLine(); } } } static———{ DrawStarAndMinus(5) } OUT PUT *****- ****- ***- **- *-
2 Respuestas
+ 8
Microne mafika Please,
If you need help, you can post the code you're struggling with!
• https://www.sololearn.com/post/75089/?ref=app
+ 1
Code about that how much you know, show your try and for the rest ask here for community help..
It's only you know use of if condition, use else part also.. There You can see solution...
Edit:
Microne mafika
Replace this in function
for (int i=n; i>=1; i--)
{
for (int j=1; j<=n; j++) {
if(i>=j)
Console.Write("*");
else Console.Write("-"); }
Console.WriteLine();
}
Note: after updating, to know others give a reply or tag someone name to know them..