C Programs to print Alphabet Pattern | alphabet pattern programs in c


Introduction

Pattern printing in C Programming Language is always a favorite topic for all new c programmers. It mainly focuses on outer & inner loops. In this article, I have explained the list of all alphabet pattern programs in c programming language. I have used Code::Blocks IDE for debugging purpose. But you can use any C programming language compiler as per your availability.


Alphabet Pattern programs in C using for loop

techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

C Language Alphabet pattern 1

A
BB
CCC
DDDD
EEEEE
  1. #include<stdio.h>
  2. void main()
  3. {
  4. int i, j;
  5. for(i=1;i<=5;i++)
  6. {
  7. for(j=1;j<=i;j++)
  8. {
  9. printf("%c",'A'-1 + i);
  10. }
  11. printf("\n");
  12. }
  13. }

C Language Alphabet pattern 2

AAAAA
BBBB
CCC
DD
E
  1. #include<stdio.h>
  2. void main()
  3. {
  4. int i, j;
  5. for(i=1;i<=5;i++)
  6. {
  7. for(j=5;j>=i;j--)
  8. {
  9. printf("%c",'A'-1 + i);
  10. }
  11. printf("\n");
  12. }
  13. }


C Language Alphabet pattern 3

A
AB
ABC
ABCD
ABCDE
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i, j;
  5. for(i=1;i<=5;i++)
  6. {
  7. for(j=1;j<=i;j++)
  8. {
  9. printf("%c",'A' + j-1);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }

C Language Alphabet pattern 4

E
DE
CDE
BCDE
ABCDE
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i, j;
  5. for(i=5;i>=1;i--)
  6. {
  7. for(j=i;j<=5;j++)
  8. {
  9. printf("%c",'A' + j-1);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }


C Language Alphabet pattern 5

A
BA
CBA
DCBA
EDCBA
  1. #include <stdio.h> 
  2. int main()
  3. {
  4. int i, j;
  5. for(i=1;i<=5;i++)
  6. {
  7. for(j=i;j>=1;j--)
  8. {
  9. printf("%c",'A' + j-1);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }

C Language Alphabet pattern 6

E
ED
EDC
EDCB
EDCBA
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i, j;
  5. for(i=5;i>=1;i--)
  6. {
  7. for(j=5;j>=i;j--)
  8. {
  9. printf("%c",'A' + j-1);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }


     


C Language Alphabet pattern 7

E
DD
CCC
BBBB
AAAAA
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i, j;
  5. for(i=5;i>=1;i--)
  6. {
  7. for(j=5;j>=i;j--)
  8. {
  9. printf("%c",'A'-1 + i);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }

C Language Alphabet pattern 8

EEEEE
DDDD
CCC
BB
A
  1. #include <stdio.h> 
  2. int main()
  3. {
  4. int i, j;
  5. for(i=5;i>=1;i--)
  6. {
  7. for(j=1;j<=i;j++)
  8. {
  9. printf("%c",'A'-1 + i);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }



Alphabet pattern 9

EDCBA
EDCB
EDC
ED
E
  1. #include <stdio.h> 
  2. int main()
  3. {
  4. int i, j;
  5. for(i=1;i<=5;i++)
  6. {
  7. for(j=5;j>=i;j--)
  8. {
  9. printf("%c",'A'-1 + j);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }

C Language Alphabet pattern 10

EDCBA
DCBA
CBA
BA
A
  1. #include <stdio.h> 
  2. int main()
  3. {
  4. int i, j;
  5. for(i=5;i>=1;i--)
  6. {
  7. for(j=i;j>=1;j--)
  8. {
  9. printf("%c",'A'-1 + j);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }


C Language Alphabet pattern 11

    A
   ABA
  ABCBA
 ABCDCBA
ABCDEDCBA
  1. #include<stdio.h> 
  2. void main()
  3. {
  4. int ch=65;
  5. int i,j,k,m;
  6. for(i=1;i<=5;i++)
  7. {
  8. for(j=5;j>=i;j--)
  9. printf(" ");
  10. for(k=1;k<=i;k++)
  11. printf("%c",ch++);
  12. ch--;
  13. for(m=1;m<i;m++)
  14. printf("%c",--ch);
  15. printf("\n");
  16. ch=65;
  17. }
  18. }

C Language Alphabet pattern 12

I
IN
IND
INDI
INDIA
  1. #include<stdio.h> 
  2. void main()
  3. {
  4. char s[]="INDIA";
  5. int i,j;
  6. for(i=0;s[i];i++)
  7. {
  8. for(j=0;j<=i;j++)
  9. printf("%c",s[j]);
  10. printf("\n");
  11. }
  12. }


     


C Language Alphabet pattern 13

1A2B3C4D5E
1A2B3C4D
1A2B3C
1A2B
1A
  1. #include <stdio.h> 
  2. int main()
  3. {
  4. int i,j,k;
  5. for(i=5; i>=1; i--)
  6. {
  7. for(j=1, k='A'; j<=i; j++,k++)
  8. {
  9. printf("%d%c",j,k);
  10. }
  11. printf("\n");
  12. }
  13. return 0;
  14. }

C Language Alphabet pattern 14

    A
   BAB
  CBABC
 DCBABCD
EDCBABCDE
  1. #include <stdio.h> 
  2. int main()
  3. {
  4. int i,j;
  5. char CH='A';
  6. int space=4;
  7. for(i=1; i<=5; i++)
  8. {
  9. for(j=1; j<=space; j++)
  10. printf(" ");
  11. //first part of the row
  12. for(j=CH; j>='A'; j--)
  13. printf("%c",j);
  14. //second part of the row
  15. for(j='B'; j<=CH; j++)
  16. printf("%c",j);
  17. printf("\n");
  18. CH++;
  19. space--;
  20. }
  21. return 0;
  22. }


C Language Alphabet pattern 15

ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE   EDCBA
ABCD     DCBA
ABC       CBA
AB         BA
A           A
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i,j,k,l,m;
  5. for(i=0;i<=6;i++)
  6. {
  7. for(k=65;k<=71-i;k++)
  8. printf("%c",k);
  9. for(j=1;j<=i*2-1;j++)
  10. printf(" ");
  11. for(l=71-i;l>=65;l--)
  12. if(l!=71)
  13. printf("%c",l);
  14. printf("\n");
  15. }
  16. return 0;
  17. }

C Language Alphabet pattern 16

A 
BC 
DEF 
GHIJ 
KLMNO
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i,j;
  5. char ch='A';
  6. for(i=1;i<=5;i++)
  7. {
  8. for(j=1;j<=i;j++)
  9. {
  10. printf("%c ",ch++);
  11. }
  12. printf("\n");
  13. }
  14. return 0;
  15. }


Alphabet pattern 17

    A
   BAB
  CBABC
 DCBABCD
EDCBABCDE
  1. #include<stdio.h> 
  2. void main()
  3. {
  4. int i,n=5,j;
  5. for(i=1;i<=n;i++)
  6. {
  7. for(j=1;j<=n-i;j++)
  8. {
  9. printf(" ");
  10. }
  11. for(j=i;j>0;j--)
  12. {
  13. printf(" %c",(char)(j+64));
  14. }
  15. for(j=2;j<=i;j++)
  16. {
  17. printf(" %c",(char)(j+64));
  18. }
  19. printf("\n");
  20. }
  21. }

C Language Alphabet pattern 18

A
BF
CGJ
DHKM
EILNO
  1. #include<stdio.h>
  2. void main()
  3. {
  4. int i,j,diff,value,n=5;
  5. for(i=1;i<=n;i++)
  6. {
  7. diff=n-1;
  8. value=i;
  9. for(j=1; j<=i; j++)
  10. {
  11. printf("%4c",(char)(value+64));
  12. value=value+diff;
  13. diff--;
  14. }
  15. printf("\n");
  16. }
  17. }


C Language Alphabet pattern 19

A
ABC
ABCDE
ABCDEFG
ABCDEFGI

  1. #include<stdio.h> 
  2. void main()
  3. {
  4. int i,j,n=5;
  5. for(i=1;i<=n;i++)
  6. {
  7. for(j=1;j<=(i*2-1);j++)
  8. {
  9. printf("%c",(char)(j+64));
  10. }
  11. printf("\n");
  12. }
  13. }

C Language Alphabet pattern 20

EFGHI
DEFG
CDE
BC
A
  1. #include<stdio.h> 
  2. void main()
  3. {
  4. int i,j,k,n=5;
  5. for(i=n;i>=1;i--)
  6. {
  7. k = i;
  8. for(j=1;j<=i;j++,k++)
  9. {
  10. printf("%c",(char)(k+64));
  11. }
  12. printf("\n");
  13. }
  14. }


C Language Alphabet pattern 21

ABCDE
BCDE
CDE
DE
E
  1. #include<stdio.h> 
  2. void main()
  3. {
  4. int i,j,n=5;
  5. for(i=1;i<=n;i++)
  6. {
  7. for(j=i;j<=n;j++)
  8. {
  9. printf("%c",(char)(j+64));
  10. }
  11. printf("\n");
  12. }
  13. }

C Language Alphabet pattern 22

    A
   BB
  CCC
 DDDD
EEEEE
  1. #include<stdio.h> 
  2. void main()
  3. {
  4. int i,j,k,n=5;
  5. for(i=1;i<=n;i++)
  6. {
  7. for(j=1;j<=n-i;j++)
  8. {
  9. printf(" ");
  10. }
  11. for(k=1;k<=i;k++)
  12. {
  13. printf("%c",(char)(i+64));
  14. }
  15. printf("\n");
  16. }
  17. }


C Language Alphabet pattern 23

       A
      ABA
     ABCBA
    ABCDCBA
   ABCDEDCBA
  1. #include<stdio.h> 
  2. void main()
  3. {
  4. int i,n,j;
  5. for(i=1;i<=5;i++)
  6. {
  7. for(j=1;j<=5-i;j++)
  8. {
  9. printf(" ");
  10. }
  11. for(j=1;j<=i;j++)
  12. {
  13. printf("%c",(char)(j+64));
  14. }
  15. for(j=i-1;j>=1;j--)
  16. {
  17. printf("%c",(char)(j+64));
  18. }
  19. printf("\n");
  20. }
  21. }

C Language Alphabet pattern 24

a
Bc
DeF
gHiJ
kLmNo
  1. #include<stdio.h>
  2. void main()
  3. {
  4. int i, j, k = 0, l = 1, n = 5;
  5. for (i = 1; i <= n; i++)
  6. {
  7. for (j = 1; j <= i; j++, k++, l++)
  8. {
  9. if (k % 2 == 0)
  10. {
  11. printf("%4c", (char)(l + 96));
  12. }
  13. else
  14. {
  15. printf("%4c", (char)(l + 64));
  16. }
  17. }
  18. printf("\n");
  19. }
  20. }


C Language Alphabet pattern 25

*
*A*
*A*A*
*A*A*A*
  1. #include<stdio.h>
  2. void main()
  3. {
  4. int i, j;
  5. for(i=1;i<=5;i++)
  6. {
  7. for(j=1;j<=i;j++)
  8. {
  9. if(j%2==0) printf("A");
  10. else printf("*");
  11. }
  12. printf("\n");
  13. }
  14. }

C Language Alphabet pattern 26

AAAAA
BBBBB
CCCCC
DDDDD
EEEEE
  1. #include<stdio.h>
  2. void main() {
  3. char i, j;
  4. for (i = 'A'; i <= 'E'; i++) {
  5. for (j = 'A'; j <= 'E'; j++) {
  6. printf("%c", i);
  7. }
  8. printf("\n");
  9. }
  10. }


C Language Alphabet pattern 27

ABCDE
ABCDE
ABCDE
ABCDE
ABCDE
  1. #include<stdio.h>
  2. void main() {
  3. char i, j;
  4. for (i = 'A'; i <= 'E'; i++) {
  5. for (j = 'A'; j <= 'E'; j++) {
  6. printf("%c", j);
  7. }
  8. printf("\n");
  9. }
  10. }

C Language Alphabet pattern 28

EEEEE
DDDDD
CCCCC
BBBBB
AAAAA
  1. #include<stdio.h>
  2. void main() {
  3. char i, j;
  4. for (i = 'E'; i >= 'A'; i--) {
  5. for (j = 'E'; j >= 'A'; j--) {
  6. printf("%c", i);
  7. }
  8. printf("\n");
  9. }
  10. }


C Language Alphabet pattern 29

EDCBA
EDCBA
EDCBA
EDCBA
EDCBA
  1. #include<stdio.h>
  2. void main() {
  3. char i, j;
  4. for (i = 'E'; i >= 'A'; i--) {
  5. for (j = 'E'; j >= 'A'; j--) {
  6. printf("%c", j);
  7. }
  8. printf("\n");
  9. }
  10. }

C Language Alphabet pattern 30

    A
   BBB
  CCCCC
 DDDDDDD
EEEEEEEEE
  1. #include<stdio.h>
  2. void main() {
  3. int m = 1;
  4. int p_height = 5;
  5. int p_space = p_height - 1;
  6. int i, j, k;
  7. for (i = 0; i < p_height; i++) {
  8. for (j = p_space; j > i; j--) {
  9. printf(" ");
  10. }
  11. for (k = 0; k < m; k++) {
  12. printf("%c", i + 65);
  13. }
  14. m += 2;
  15. printf("\n");
  16. }
  17. }


    A
   CCC 
  EEEEE 
 GGGGGGG
IIIIIIIII
  1. #include<stdio.h>
  2. void main() {
  3. int m = 0;
  4. int p_height = 5;
  5. int p_space = p_height - 1;
  6. int i, j, k;
  7. for (i = 0; i < p_height; i++) {
  8. for (j = p_space; j > i; j--) {
  9. printf(" ");
  10. }
  11. for (k = 0; k <= m; k++) {
  12. printf("%c", m + 65); // 65 is the ASCII of 'A'
  13. }
  14. m += 2;
  15. printf("\n");
  16. }
  17. }






Related Topics





Popular Posts