In this tutorial, we will discuss the concept of C program to display the alphabet pattern.
In this post, we will display ten alphabet patterns program and explain how to print using for loop
Program 1
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 1\n"); int i,j; for(i=1; i<=5; i++){ for(j=1; j<=i; j++){ printf("%c",'A'-1+i); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 1 A BB CCC DDDD EEEEE
Program 2
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 2\n\n"); int i,j; for(i=1; i<=5; i++){ for(j=5; j>=i; j--){ printf("%c",'A'-1+i); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 2 AAAAA BBBB CCC DD E
Program 3
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 3\n\n"); int i,j; for(i=1; i<=5; i++){ for(j=1; j<=i; j++){ printf("%c",'A'+j-1); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 3 A AB ABC ABCD ABCDE
Program 4
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 4\n\n"); int i,j; for(i=6; i>=1; i--){ for(j=i; j<=6; j++){ printf("%c",'A'+j-1); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 4 E EF DEF CDEF BCDEF ABCDEF
Program 5
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 5\n\n"); int i,j; for(i=1; i<=6; i++){ for(j=i; j>=1; j--){ printf("%c",'A'+j-1); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 5 A BA CBA DCBA EDCBA FEDCBA
Program 6
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 5\n\n"); int i,j; for(i=6; i>=1; i--){ for(j=6; j>=i; j--){ printf("%c",'A'+j-1); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 6 F FE FED FEDC FEDCB FEDCBA
Program 7
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 5\n\n"); int i,j; for(i=6; i>=1; i--){ for(j=1; j<=i; j++){ printf("%c",'A'-1+i); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 7 FFFFFF EEEEE DDDD CCC BB A
Program 8
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 8\n\n"); int i,j; for(i=6; i>=1; i--){ for(j=6; j>=i; j--){ printf("%c",'A'-1+i); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 8 F EE DDD CCCC BBBBB AAAAAA
Program 9
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 8\n\n"); int i,j; for(i=1; i<=6; i++){ for(j=6; j>=i; j--){ printf("%c",'A'-1+j); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphaber pattern 9 FEDCBA FEDCB FEDC FED FD F
Program 10
#include <stdio.h> #include <stdlib.h> int main() { printf("Alphabet pattern 10\n\n"); int i,j; for(i=6; i>=1; i--){ for(j=i; j>=1; j--){ printf("%c",'A'-1+j); } printf("\n"); } getch(); return 0; }
When the above code is executed, it produces the following results
Alphabet pattern 10 FEDCBA EDCBA DCBA CBA BA A
C program for loop
PHP Star Triangle pattern program In this tutorial, we will discuss about PHP Star Triangle…
PHP Full Pyramid pattern program In this tutorial, we will discuss about PHP Full Pyramid…
5 methods to add two numbers in Java In this tutorial, we will discuss the…
Python full Pyramid star pattern program In this tutorial, we will discuss the concept of…
Write a function or method to convert C into F -Entered by the user In…
How to write a function or method to convert Celsius into Fahrenheit In this tutorial,…