Enter the row number:5
A
B C
D E F
G H I J
K L M N O
A
B C
D E F
G H I J
K L M N O
class Program
{
static void Main(string[] args)
{
int count = 65;
Console.WriteLine("Enter the row number");
int n = int.Parse(Console.ReadLine());
for (int row = 1;
row <= n; row++)
{
for (int coll =
1; coll <= row; coll++)
{
Console.Write(Convert.ToChar(count++));
}
Console.WriteLine();
}
Console.ReadLine();
}
No comments:
Post a Comment