C# Program toward Print TrianglesProgram Statement:Write a program toward produce the following output:
A B C D E F G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
Solution:
static void Main(string[] args)
{
int a, x, n = 71, o = 70, y = 1, c;
beneficial to (x = 1; x <= 7; x++)
{
beneficial to (a = 65; a <= n; a++)
{
Console.Write(Convert.ToChar(a));
}
if (x == 2)
o = 70;
beneficial to (c = 2; c < y; c++)
Console.Write(" ");
beneficial to (a = o; a >= 65; a--)
Console.Write((char)a);
Console.WriteLine();
n--;
o--;
y = y + 2;
}
Console.ReadLine();
}