#Day 12: Creating an Uppercase Alphabet Triangle Pattern in C#.
Welcome to Day 12 of our C# programming patterns series.
Today, we'll learn how to create an uppercase alphabet triangle pattern in C#. This pattern displays uppercase letters in a triangular form, with each row increasing by one letter.
It's a great exercise to practice nested loops and character manipulation in C#.
Let’s dive into the code and see how to implement this interesting pattern.
Here’s the pattern:
A
B B
C C C
D D D D
E E E E E
Source Code :
using System;
namespace Pyramid
{
internal class Program
{
static void Main(string[] args)
{
int n = 69;
for(int i = 65; i <= n; i++)
{
for(int j=65;j<=i;j++)
{
Console.Write((char)i);
}
Console.WriteLine();
}
Console.Read();
}
}
}
OutPut:
Stay tuned for Day 13, where we'll continue exploring more C# patterns and concepts!
Don’t 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 in C#
#Day 7:Creating an Reverse Alphabet Triangle Pattern in C#
#Day 8: Creating an Inverted Alphabet Triangle Pattern in C#
#Day 9: Creating a Numeric Triangle Pattern in C#
#Day 10: Creating a Reverse Numeric Triangle Pattern in C#.Net.
Pattern Follow us on Instagram:
@LearnCodingWithDotNet for daily coding patterns and tips.
No comments:
Post a Comment