#Day 7 :101 Days Pyramid Pattern in C# .NET

 #Day 7: Creating a Reverse Alphabet Triangle Pattern in C#

Welcome to Day 7 of our 101 Days Pyramid Pattern in C# .NET series. 

Today, we'll learn how to create a reverse alphabet triangle pattern in C#. This pattern displays letters in reverse order, starting with 'a' at the top and adding an extra letter to each subsequent row in reverse.

This example will help you understand nested loops and character manipulation in C#. Let’s dive into the code and see how to implement this intriguing pattern.

In this blog post, we'll create a reverse alphabet triangle pattern using C#. The pattern will look like this:


a

b a

c b a

d c b a

e d c b a

To achieve this, we'll use nested loops to control the rows and columns of the triangle. Here’s the complete code:


Source Code :


using System;

namespace Pyramid

{

    internal class Program

    {

        static void Main(string[] args)

        {

            int n = 101;


            for(int i = 97; i <= n; i++)

            {

                for(int j=i;j>=97;j--)

                {

                    Console.Write((char)j);

                }

                Console.WriteLine();

            }

            Console.Read();

        }

    }

}

OutPut:




Stay tuned for Day 8, where we'll continue exploring more C# patterns and concepts!

Dont forget to share this post if you found it helpful and follow us for more C# programming tips and tutorials. Happy coding!

Related Posts:

#Day 1:Number Pyramid in C#



#Day 5:Alphabet Pyramid Pattern

#Day 6:Creating an Alphabet Triangle Pattern iC#



 Pattern Follow us on Instagram: 

@LearnCodingWithDotNet for daily coding patterns and tips.







No comments:

Post a Comment