Fig: Screenshot of output |
using System;
class PatternTest
{
public static void Main()
{
int j,k,row,r=1;
Console.Write("Enter the no. of row: ");
row=Convert.ToInt32(Console.ReadLine());
for(;row>=1;row--,r++)
{
for(j=r;j>=1;j--)
Console.Write(" ");
for(j=1;j<=row;j++)
Console.Write(j);
for(k=row-1;k>=1;k--)
Console.Write(k);
Console.WriteLine();
}
}
}