Alphabet Pattern 16-Pyramid pattern using alphabets in C programming
In this program, we will see the Pyramid pattern using alphabets in C programming language. Please look into the program.
A ABA ABCBA ABCDCBA ABCDEDCBA
The C program for the Pyramid or triangle pattern using alphabets is as follows:
#include <stdio.h> int main() { int a,b; int spaces=4; char CH='A'; /*Run parent loop*/ for(a=1; a<=5; a++) { /*Print spaces*/ for(b=1; b<=spaces; b++) printf(" "); /*Run loop to print first part of row*/ for(b=1; b<=a; b++) printf("%c",CH+b-1); /*Run loop to print second part of row*/ for(b=a-1; b>=1; b--) printf("%c",CH+b-1); printf("n"); spaces--; } getch(); return 0; }