Skip to content

Instantly share code, notes, and snippets.

@ertugrulozcan
Created March 26, 2022 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ertugrulozcan/392572a57319fb851e3559303ad8a56e to your computer and use it in GitHub Desktop.
Save ertugrulozcan/392572a57319fb851e3559303ad8a56e to your computer and use it in GitHub Desktop.
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