This is very basic logic. In my code I assume that the use entered 5 and set the n= 5.
private void display()
{
int n = 5;
int count = 0;
for (int i = 0; i <= n; i++)
{
for (int j = 0; j < i; j++)
{
count++;
Console.Write(" " + count);
}
Console.Write("\n");
}
}