In this article, we will learn how to print different C alphabet pattern program. We will use two loops to print pattern: one outer loop and one inner loop. The outer loop will point to each row of the pattern and the inner loop will print the characters. Following is the list of programs:
Pattern 1
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=1; j<=i; j++) { printf("%c ", alphabet); alphabet++; } printf("\n"); } return 0; }
Pattern 2
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=5; i>=1; i--) { for (j=1; j<=i; j++) { printf("%c ", alphabet); alphabet++; } printf("\n"); } return 0; }
Pattern 3
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=1; j<=i; j++) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 4
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=5; i>=1; i--) { for (j=1; j<=i; j++) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 5
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=5; j>=i; j--) { alphabet = alphabet+i; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 6
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=1; j<=i; j++) { alphabet = alphabet+i; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 7
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=5; j>=i; j--) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 8
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=5; i>=1; i--) { for (j=5; j>=i; j--) { alphabet = alphabet+i; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 9
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=1; j<=5; j++) { printf("%c ", alphabet); alphabet++; } printf("\n"); } return 0; }
Pattern 10
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=1; j<=5; j++) { printf("%c ", alphabet); } printf("\n"); alphabet++; } return 0; }
Pattern 11
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=i; j<=5; j++) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 12
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=5; i>=1; i--) { for (j=i; j>=1; j--) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 13
Program
#include<stdio.h> int main() { int i, j, k; char alphabet='A'; for(i=1; i<=5; i++) { for (j=5-i; j>=1; j--) { printf(" "); } for(k=1; k<=i; k++) { alphabet = alphabet+k; printf("%c", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 14
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=5; i>=1; i--) { for (j=i; j<=5; j++) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 15
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=i; j>=1; j--) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 16
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=5; i>=1; i--) { for (j=1; j<=i; j++) { alphabet = alphabet+i; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 17
Program
#include<stdio.h> int main() { int i, j, k; char alphabet='A'; for(i=5; i>=1; i--) { for (j=1; j<i; j++)
{
printf(" ");
}
for(k=5; k>=i; k++) { alphabet = alphabet+k; printf("%c", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 18
Program
#include<stdio.h>
int main()
{
int i, j, k;
char alphabet='A';
for (i=1; i<=5; i++)
{
for (j=5; j>i; j--)
{
printf(" ");
}
for (k=1; k<=i; k++)
{
alphabet = alphabet+k;
printf("%c ", alphabet-1);
alphabet='A';
}
printf("\n");
}
return 0;
}
Pattern 19
Program
#include<stdio.h> int main() { int i, j; char alphabet='A'; for(i=1; i<=5; i++) { for (j=1; j<=5; j++) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 20
Program
#include<stdio.h> int main() { int i, j, k; char alphabet='A'; for(i=1; i<=5; i++) { for (j=5; j>i; j--) { printf(" "); } for(k=1; k<=i; k++) { alphabet = alphabet+i; printf("%c", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 21
Program
#include<stdio.h> int main() { int i, j, k; char alphabet='A'; for(i=1; i<=5; i++) { for (j=1; j<=5-i; j++) { printf(" "); } for(k=1; k<=i; k++) { alphabet = alphabet+j; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 22
Program
#include<stdio.h> int main() { int i, j, k; char alphabet='A'; for(i=5; i>=1; i--) { for (j=1; j<=5-i; j++) { printf(" "); } for(k=1; k<=i; k++) { alphabet = alphabet+k; printf("%c ", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Pattern 23
Program
#include<stdio.h> int main() { int i, j, k; char alphabet='A'; for(i=5; i>=1; i--) { for (j=1; j<=5-i; j++) { printf(" "); } for(k=1; k<=i; k++) { alphabet = alphabet+k; printf("%c", alphabet-1); alphabet='A'; } printf("\n"); } return 0; }
Note:
- All the programs are compiled and executed in Dev C++ code editor and save with .c extension.