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