Enter the row number: 5
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the row number");
int n = int.Parse(Console.ReadLine());
for (int row = 0;
row <= n; row++)
{
for (int coll =
row; coll >= 1; coll--)
{
Console.Write(coll);
}
Console.WriteLine();
}
Console.ReadLine();
}
}
No comments:
Post a Comment