Saturday 22 November 2014

Number Pattern in C# - 3

using System;
class PatternProgramming
{
public static void Main()
{
int i,j,row;

Console.Write("Enter the no. of line you have to print: ");
row=Convert.ToInt32(Console.ReadLine());

for(j=1;j<=row;j++)
{
for(i=1;i<=row;i++)
Console.Write(" ");

for(i=row;i>=1;i--)
Console.Write(i);
Console.WriteLine();
}
}
}
Snapshot of Output of Number pattern in c-sharp
Fig: Snapshots of Output