Topics
Introduction
In this article, I have explained the list of all alphabet pattern programs in C# programming language. Following exercise is compiled and tested on a Visual Studio 2012.
Alphabet pattern : 1
A
BB
CCC
DDDD
EEEEE
BB
CCC
DDDD
EEEEE
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { Console.Write((char)(i+64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern : 2
AAAAA
BBBB
CCC
DD
E
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = 1; i <= n; i++) { for (j = i; j <= n; j++) { Console.Write((char)(i+64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern : 3
A
AB
ABC
ABCD
ABCDE
AB
ABC
ABCD
ABCDE
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = 1; i <= n; i++) { for (j = 1; j <= i; j++) { Console.Write((char)(j+64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern : 4
E
DE
CDE
BCDE
ABCDE
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = n; i >= 1; i--) { for (j = i; j <= n; j++) { Console.Write((char)(j+64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern : 5
A
BA
CBA
DCBA
EDCBA
BA
CBA
DCBA
EDCBA
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = 1; i <= n; i++) { for (j = i; j >= 1; j--) { Console.Write((char)(j+64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern : 6
E
ED
EDC
EDCB
EDCBA
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = n; i >= 1; i--) { for (j = n; j >= i; j--) { Console.Write((char)(j+64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern 7
E
DD
CCC
BBBB
AAAAA
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = 1; i <= n; i++) { for (j = 1; j <= i; j++) { Console.Write((char)(n - i + 1 + 64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern 8
EEEEE
DDDD
CCC
BB
A
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = n; i >= 1; i--) { for (j = 1; j <= i; j++) { Console.Write((char)(i + 64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Also check
All star patterns using C# programming Language
All number patterns using C# programming Language
Alphabet pattern 9
EDCBA
EDCB
EDC
ED
E
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = 1; i <= n; i++) { for (j = n; j >= i; j--) { Console.Write((char)(j + 64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern 10
EDCBA
DCBA
CBA
BA
A
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; int n=5; for (i = n; i >= 1; i--) { for (j = i; j >= 1; j--) { Console.Write((char)(j + 64)); } Console.WriteLine(""); } Console.ReadLine(); } }
Alphabet pattern 11
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j; int n = 5; for (i = 1; i <= n; i++) { for (j = 1; j <= n - i; j++) { Console.Write(" "); } for (j = 1; j <= i; j++) { Console.Write((char)(j + 64)); } for (j = i - 1; j >= 1; j--) { Console.Write((char)(j + 64)); } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 12
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j, charValue; charValue = 65; for (i = 1; i <= 7; i++) { Console.WriteLine(" "); for (j = 1; j <= i; j++) { Console.Write(" " + Convert.ToChar(charValue)); charValue++; if (charValue == 91) { break; } } } Console.ReadLine(); } }
Alphabet pattern 13
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j, k; char c = 'A'; int n = 5; for (i = 0; i <= n; i++) { for (j = 0; j <= i; j++) { Console.Write(" "); } for (k = n - i - 1; k >= 0; k--) { Console.Write(c); c++; } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 14
A
BC
DEF
GHIJ
KLMNO
using System; public class AlphabetPattern { public static void Main(string[] args) { int i,j; char c; int n=5; c='A'; for (i = 0; i < n; i++) { for (j = 0; j <= i; j++) { if (c == 'Z') break; Console.Write(c); c++; } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 15
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j; char CH = 'E'; int space = 1; for (i = 1; i <= 5; i++) { for (j = 'A'; j <= CH; j++) Console.Write((char)(j)); if (i == 1) Console.Write("\b"); for (j = 1; j < space; j++) Console.Write(" "); for (j = CH; j >= 'A'; j--) Console.Write((char)(j)); Console.WriteLine(); CH--; space++; } Console.ReadLine(); } }
Alphabet pattern 16
A
B C
D E F
G H I J
K L M N O
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j; char ch = 'A'; for (i = 1; i <= 5; i++) { for (j = 1; j <= i; j++) { Console.Write(ch++); } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 17
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j; int n = 5; for (i = 1; i <= n; i++) { for (j = 1; j <= n - i; j++) { Console.Write(" "); } for (j = i; j > 0; j--) { Console.Write((char)(j + 64)); } for (j = 2; j <= i; j++) { Console.Write((char)(j + 64)); } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 18
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j; int n = 5; int diff, value; for (i = 1; i <= n; i++) { diff = n - 1; value = i; for (j = 1; j <= i; j++) { Console.Write((char)(value + 64)); value = value + diff; diff--; } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 19
A
A B C
A B C D E
A B C D E F G
A B C D E F G H I
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j; int n = 5; for (i = 1; i <= n; i++) { for (j = 1; j <= (i * 2 - 1); j++) { Console.Write((char)(j + 64)); } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 20
E F G H I
D E F G
C D E
B C
A
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j, k; int n = 5; for (i = n; i >= 1; i--) { k = i; for (j = 1; j <= i; j++, k++) { Console.Write((char)(k + 64)); } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 21
A B C D E
B C D E
C D E
D E
E
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j; int n = 5; for (i = 1; i <= n; i++) { for (j = i; j <= n; j++) { Console.Write((char)(j + 64)); } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 22
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j, k; int n = 5; for (i = 1; i <= n; i++) { for (j = 1; j <= n - i; j++) { Console.Write(" "); } for (k = 1; k <= i; k++) { Console.Write((char)(i + 64)); } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 23
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j, k; char c = 'A'; int n = 6; for (i = 0; i <= n; i++) { for (j = 0; j <= i; j++) { Console.Write(" "); } for (k = n - i - 1; k >= 0; k--) { Console.Write(c); c++; } Console.WriteLine(); } Console.ReadLine(); } }
Alphabet pattern 24
A
BC
DEF
GHIJ
KLMNO
PQRSTU
using System; public class AlphabetPattern { public static void Main(string[] args) { int i, j; char c; int n = 6; c = 'A'; for (i = 0; i < n; i++) { for (j = 0; j <= i; j++) { if (c == 'Z') break; Console.Write(c); c++; } Console.WriteLine(); } Console.ReadLine(); } }