In this code i will try to slow your problem. Hope it will help you.
Program:
using System;
class PyramidNumbers
{
public static void Main()
{
int i,j,num=5,k;
for(i=1;i<=num;i++)
{
for(k=num;k>=i;k--)// Loop for the blank spaces
{
Console.Write(" ");
}
for(j=1;j<=i;j++)// Loop for determining the number of times the number is to be written
{
Console.Write(" " +i); // " " is a space needed in between the numbers
}
Console.Write("\n"); // Go to the next line for next number
}
Console.ReadLine();
}
}