Topics
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
C Language Alphabet pattern 1
A BB CCC DDDD EEEEE
#include<stdio.h> void main() { int i, j; for(i=1;i<=5;i++) { for(j=1;j<=i;j++) { printf("%c",'A'-1 + i); } printf("\n"); } }
C Language Alphabet pattern 2
AAAAA BBBB CCC DD E
#include<stdio.h> void main() { int i, j; for(i=1;i<=5;i++) { for(j=5;j>=i;j--) { printf("%c",'A'-1 + i); } printf("\n"); } }
C Language Alphabet pattern 3
A AB ABC ABCD ABCDE
#include <stdio.h> int main() { int i, j; for(i=1;i<=5;i++) { for(j=1;j<=i;j++) { printf("%c",'A' + j-1); } printf("\n"); } return 0; }
C Language Alphabet pattern 4
E DE CDE BCDE ABCDE
#include <stdio.h> int main() { int i, j; for(i=5;i>=1;i--) { for(j=i;j<=5;j++) { printf("%c",'A' + j-1); } printf("\n"); } return 0; }
C Language Alphabet pattern 5
A BA CBA DCBA EDCBA
#include <stdio.h> int main() { int i, j; for(i=1;i<=5;i++) { for(j=i;j>=1;j--) { printf("%c",'A' + j-1); } printf("\n"); } return 0; }
C Language Alphabet pattern 6
E ED EDC EDCB EDCBA
#include <stdio.h> int main() { int i, j; for(i=5;i>=1;i--) { for(j=5;j>=i;j--) { printf("%c",'A' + j-1); } printf("\n"); } return 0; }
C Language Alphabet pattern 7
E DD CCC BBBB AAAAA
#include <stdio.h> int main() { int i, j; for(i=5;i>=1;i--) { for(j=5;j>=i;j--) { printf("%c",'A'-1 + i); } printf("\n"); } return 0; }
C Language Alphabet pattern 8
EEEEE DDDD CCC BB A
#include <stdio.h> int main() { int i, j; for(i=5;i>=1;i--) { for(j=1;j<=i;j++) { printf("%c",'A'-1 + i); } printf("\n"); } return 0; }
Alphabet pattern 9
EDCBA EDCB EDC ED E
#include <stdio.h> int main() { int i, j; for(i=1;i<=5;i++) { for(j=5;j>=i;j--) { printf("%c",'A'-1 + j); } printf("\n"); } return 0; }
C Language Alphabet pattern 10
EDCBA DCBA CBA BA A
#include <stdio.h> int main() { int i, j; for(i=5;i>=1;i--) { for(j=i;j>=1;j--) { printf("%c",'A'-1 + j); } printf("\n"); } return 0; }
C Language Alphabet pattern 11
A ABA ABCBA ABCDCBA ABCDEDCBA
#include<stdio.h> void main() { int ch=65; int i,j,k,m; for(i=1;i<=5;i++) { for(j=5;j>=i;j--) printf(" "); for(k=1;k<=i;k++) printf("%c",ch++); ch--; for(m=1;m<i;m++) printf("%c",--ch); printf("\n"); ch=65; } }
C Language Alphabet pattern 12
I IN IND INDI INDIA
#include<stdio.h> void main() { char s[]="INDIA"; int i,j; for(i=0;s[i];i++) { for(j=0;j<=i;j++) printf("%c",s[j]); printf("\n"); } }
C Language Alphabet pattern 13
1A2B3C4D5E 1A2B3C4D 1A2B3C 1A2B 1A
#include <stdio.h> int main() { int i,j,k; for(i=5; i>=1; i--) { for(j=1, k='A'; j<=i; j++,k++) { printf("%d%c",j,k); } printf("\n"); } return 0; }
C Language Alphabet pattern 14
A BAB CBABC DCBABCD EDCBABCDE
#include <stdio.h> int main() { int i,j; char CH='A'; int space=4; for(i=1; i<=5; i++) { for(j=1; j<=space; j++) printf(" "); //first part of the row for(j=CH; j>='A'; j--) printf("%c",j); //second part of the row for(j='B'; j<=CH; j++) printf("%c",j); printf("\n"); CH++; space--; } return 0; }
C Language Alphabet pattern 15
ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD DCBA ABC CBA AB BA A A
#include<stdio.h> int main() { int i,j,k,l,m; for(i=0;i<=6;i++) { for(k=65;k<=71-i;k++) printf("%c",k); for(j=1;j<=i*2-1;j++) printf(" "); for(l=71-i;l>=65;l--) if(l!=71) printf("%c",l); printf("\n"); } return 0; }
C Language Alphabet pattern 16
A BC DEF GHIJ KLMNO
#include <stdio.h> int main() { int i,j; char ch='A'; for(i=1;i<=5;i++) { for(j=1;j<=i;j++) { printf("%c ",ch++); } printf("\n"); } return 0; }
Alphabet pattern 17
A BAB CBABC DCBABCD EDCBABCDE
#include<stdio.h> void main() { int i,n=5,j; for(i=1;i<=n;i++) { for(j=1;j<=n-i;j++) { printf(" "); } for(j=i;j>0;j--) { printf(" %c",(char)(j+64)); } for(j=2;j<=i;j++) { printf(" %c",(char)(j+64)); } printf("\n"); } }
C Language Alphabet pattern 18
A BF CGJ DHKM EILNO
#include<stdio.h> void main() { int i,j,diff,value,n=5; for(i=1;i<=n;i++) { diff=n-1; value=i; for(j=1; j<=i; j++) { printf("%4c",(char)(value+64)); value=value+diff; diff--; } printf("\n"); } }
C Language Alphabet pattern 19
A ABC ABCDE ABCDEFG ABCDEFGI
#include<stdio.h> void main() { int i,j,n=5; for(i=1;i<=n;i++) { for(j=1;j<=(i*2-1);j++) { printf("%c",(char)(j+64)); } printf("\n"); } }
C Language Alphabet pattern 20
EFGHI DEFG CDE BC A
#include<stdio.h> void main() { int i,j,k,n=5; for(i=n;i>=1;i--) { k = i; for(j=1;j<=i;j++,k++) { printf("%c",(char)(k+64)); } printf("\n"); } }
C Language Alphabet pattern 21
ABCDE BCDE CDE DE E
#include<stdio.h> void main() { int i,j,n=5; for(i=1;i<=n;i++) { for(j=i;j<=n;j++) { printf("%c",(char)(j+64)); } printf("\n"); } }
C Language Alphabet pattern 22
A BB CCC DDDD EEEEE
#include<stdio.h> void main() { int i,j,k,n=5; for(i=1;i<=n;i++) { for(j=1;j<=n-i;j++) { printf(" "); } for(k=1;k<=i;k++) { printf("%c",(char)(i+64)); } printf("\n"); } }
C Language Alphabet pattern 23
A ABA ABCBA ABCDCBA ABCDEDCBA
#include<stdio.h> void main() { int i,n,j; for(i=1;i<=5;i++) { for(j=1;j<=5-i;j++) { printf(" "); } for(j=1;j<=i;j++) { printf("%c",(char)(j+64)); } for(j=i-1;j>=1;j--) { printf("%c",(char)(j+64)); } printf("\n"); } }
C Language Alphabet pattern 24
a Bc DeF gHiJ kLmNo
#include<stdio.h> void main() { int i, j, k = 0, l = 1, n = 5; for (i = 1; i <= n; i++) { for (j = 1; j <= i; j++, k++, l++) { if (k % 2 == 0) { printf("%4c", (char)(l + 96)); } else { printf("%4c", (char)(l + 64)); } } printf("\n"); } }
C Language Alphabet pattern 25
* *A* *A*A* *A*A*A*
#include<stdio.h> void main() { int i, j; for(i=1;i<=5;i++) { for(j=1;j<=i;j++) { if(j%2==0) printf("A"); else printf("*"); } printf("\n"); } }
C Language Alphabet pattern 26
AAAAA BBBBB CCCCC DDDDD EEEEE
#include<stdio.h> void main() { char i, j; for (i = 'A'; i <= 'E'; i++) { for (j = 'A'; j <= 'E'; j++) { printf("%c", i); } printf("\n"); } }
C Language Alphabet pattern 27
ABCDE ABCDE ABCDE ABCDE ABCDE
#include<stdio.h> void main() { char i, j; for (i = 'A'; i <= 'E'; i++) { for (j = 'A'; j <= 'E'; j++) { printf("%c", j); } printf("\n"); } }
C Language Alphabet pattern 28
EEEEE DDDDD CCCCC BBBBB AAAAA
#include<stdio.h> void main() { char i, j; for (i = 'E'; i >= 'A'; i--) { for (j = 'E'; j >= 'A'; j--) { printf("%c", i); } printf("\n"); } }
C Language Alphabet pattern 29
EDCBA EDCBA EDCBA EDCBA EDCBA
#include<stdio.h> void main() { char i, j; for (i = 'E'; i >= 'A'; i--) { for (j = 'E'; j >= 'A'; j--) { printf("%c", j); } printf("\n"); } }
C Language Alphabet pattern 30
A BBB CCCCC DDDDDDD EEEEEEEEE
#include<stdio.h> void main() { int m = 1; int p_height = 5; int p_space = p_height - 1; int i, j, k; for (i = 0; i < p_height; i++) { for (j = p_space; j > i; j--) { printf(" "); } for (k = 0; k < m; k++) { printf("%c", i + 65); } m += 2; printf("\n"); } }
C Language Alphabet pattern 31
#include<stdio.h> void main() { int m = 0; int p_height = 5; int p_space = p_height - 1; int i, j, k; for (i = 0; i < p_height; i++) { for (j = p_space; j > i; j--) { printf(" "); } for (k = 0; k <= m; k++) { printf("%c", m + 65); // 65 is the ASCII of 'A' } m += 2; printf("\n"); } }
Also check
A
BC
CDE
DEFG
Aa
Aa Bb
Aa Bb Cc
Aa Bb Cc Dd
Print this
Try This code
#include
main()
{
int i,j;
char c;
for(i=1;i<5;i++)
{
c='A';
for(j=1;j<=i;j++,c++) { printf("%c%c\t",c,c+32); } printf("\n"); } }
#include
int main() {
int i,j,k=0,l=1,n=5;
for(i=0;i<=n;++i){
for(j=0;j<=i;++j)
printf("%c%c",'A'+j,'a'+j);
printf("\n");
}
}
try this .it is working
How to print this pattern in C language?
aA
aabD
aaabb*G
aaaabbb**J
aaaaabbbb***M
aaaaaabbbbb****P
A
b c
D E F
g h i j
K L M N O
print this.
#include
int main() {
int i,j,k=0,l=1,n=5;
for(i=0;i<=n;++i){
for(j=0;j<=i;++j)
if(i%2==0){
printf("%c",'A'+j);
}
else{
printf("%c",'a'+j);
}
printf("\n");
}
}
this code is working like that .check it
a
b C
d E f
g H i j
k L m N o
print this.
#include
int main() {
int i,j,n=5;
char ch=’a’;
char cn=’A’;
for(i=0;i<=n;++i){
for(j=0;j<=i;++j)
if(j%2==0){
printf("%c ",++ch-1,++cn);
}else{
printf("%c ",++cn-1,++ch);
}
printf("\n");
}
}
try this code.it is working
#include
int main() {
int i,j,n=5;
char ch=’a’;
char cn=’A’;
for(i=0;i<=n;++i){
for(j=0;j<=i;++j)
if(j%2==0){
printf("%c ",++ch-1,++cn);
}else{
printf("%c ",++cn-1,++ch);
}
printf("\n");
}
}
use this code .this prints that
1
0 1
0 1 0
1 0 1 0
1 0 1 0 1
print this.
A B C D E
A B C D
A B C
A B
A
Plz print this program.
for(i=5;i>=1;i–)
{
for(j=1;j<=i;j++)
{
printf("%c",'A' + j-1);
}
printf("\n");
}
KLMNO
GHIJ
DEF
BC
A
CAN YOU PLEASE PRINT THIS PATTERN?
i can print only this.
#include
int main() {
int i,j,n=4;
char ch=’P’;
for(i=0;i<=n;++i){
for(j=0;j<=n-i;++j)
printf("%c ",–ch);
printf("\n");
}
}
#include
int main() {
int i,j,n=5;
for(i=n;i>0;–i){
for(j=0;j<=i-1;++j)
printf("%c ",'A'+j);
printf("\n");
}
}
the code is this .use this code
A
ABC
ABCDE
ABCDEFG
ABCDEFGHI
ABCDEFG
ABCDE
ABC
A
use this code .
#include
int main() {
int i,j,value=4;
for(i=0;i<=value;++i){
for(j=0;j<=i*2;++j)
printf("%c ",'A'+j);
printf("\n");
}
for(i=0;i<=value-1;++i){
for(j=0;j<=value-i*2+2;++j)
printf("%c ",'A'+j);
printf("\n");
}
}
A
1. 2.
A. B. C.
1. 2. 3. 4.
Print this
this code is working .just like that
#include
int main() {
int i,j,n=4;
for(i=0;i<=n;++i){
for(j=0;j<=i;++j)
if(i%2==0){
printf("%c.",'A'+j);
}
else{
printf("%d.",+j+1);
}
printf("\n");
}
}
A
b c
D E F
g h i j
K L M N O
print this help
yup. this code just print like that
#include
int main() {
int i,j,n=4;
char ch=’A’;
char cn=’a’;
for(i=0;i<=n;++i){
for(j=0;j<=i;++j)
if(i%2==0){
printf("%c ",++ch-1,++cn);
}
else{
printf("%c ",++cn-1,++ch);
}
printf("\n");
}
}
hey bro do you how to do this pattern
1
121
13231
1432341
A
1 1
B B B
2 2 2 2
C C C C C
Coding for this pattern:-
ZYXWVWXYZ
ZYXWXYZ
ZYXYZ
ZYZ
Z
abcdefghijklmnopqrstuvwxyz
bcdefghijklmnopqrstuvwxyza
…..
……
…
… till
zyxwvutsrqponmlkjihgfedcba
A B C
D E
F
Plz print this urgently
I really need it urgent now