Created
March 26, 2022 21:51
-
-
Save ertugrulozcan/392572a57319fb851e3559303ad8a56e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
/* | |
* | |
*** | |
***** | |
******* | |
********* | |
******* | |
***** | |
*** | |
* | |
*/ | |
/* | |
* | |
* * | |
* * | |
* * | |
* * | |
* * | |
* * | |
* * | |
* | |
*/ | |
namespace HackerRank.DiagonalDifference | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
DrawTriangle(5); | |
} | |
private static void DrawTriangle(int n) | |
{ | |
for (int satirNo = 0; satirNo < n; satirNo++) | |
{ | |
for (int j = n - 1 - satirNo; j > 0; j--) | |
{ | |
Console.Write(" "); | |
} | |
for (int i = 0; i < 2 * satirNo + 1; i++) | |
{ | |
Console.Write("*"); | |
} | |
Console.WriteLine(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment