top of page

Pyramids and Patterns Programs in C

Aug 13, 2022
2 min read

Updated: Aug 14, 2022



1. Half Pyramid of * programs in C

*

* *

* * *

* * * *

* * * * *


Program:

#include <stdio.h>

#include<conio.h>

void main()

{

int i, j;

clrscr();

for (i = 1; i <= 5; ++i)

{

for (j = 1; j <= i; ++j)

{

printf("* ");

}

printf("\n");

}

getch();

}


2. C program of Inverted half pyramid of *

* * * * *

* * * *

* * *

* *

*

Program:

#include <stdio.h>

#include<conio.h>

void main()

{

int i, j;


for (i = 5; i >= 1; --i)

{

for (j = 1; j <= i; ++j)

{

printf("* ");

}

printf("\n");

}

getch();

}

3. C program for Half Pyramid of Numbers


1

1 2

1 2 3

1 2 3 4

1 2 3 4 5


Program:

#include <stdio.h>

#include<conio.h>

void main()

{

int i, j;

clrscr();

for (i = 1; i <= 5; ++i)

{

for (j = 1; j <= i; ++j)

{

printf("%d ", j);

}

printf("\n");

}

getch();

}



4. C Program for Inverted half pyramid of numbers:


1 2 3 4 5

1 2 3 4

1 2 3

1 2

1


Program:

#include <stdio.h>

#include<conio.h>

void main()

{

int i, j;

for (i = 5; i >= 1; --i)

{

for (j = 1; j <= i; ++j)

{

printf("%d ", j);

}

printf("\n");

}

getch();

}


5. C program for Half Pyramid of Alphabets:

A

B B

C C C

D D D D

E E E E E


Program:

#include <stdio.h>

#include<conio.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");

}

getch();

}



6.C Program for Alphabet pattern:

A

AB

ABC

ABCD

ABCDE

Program:

#include<stdio.h>

#include<conio.h>

void main()

{

int i, j;

for(i=1;i<=5;i++)

{

for(j=1;j<=i;j++)

{

printf("%c",'A' + j-1);

}

printf("\n");

}

getch();

}


7. C Program for Alphabet pattern:

A

BA

CBA

DCBA

EDCBA


Program:

#include <stdio.h>

#include<conio.h>

void main()

{

int i, j;

for(i=1;i<=5;i++)

{

for(j=i;j>=1;j--)

{

printf("%c",'A' + j-1);

}

printf("\n");

}

getch();

}



8. C Program Alphabet pattern:


EEEEE

DDDD

CCC

BB

A


Program:

#include <stdio.h>

#include<conio.h>

void main()

{

int i, j;

for(i=5;i>=1;i--)

{

for(j=1;j<=i;j++)

{

printf("%c",'A'-1 + i);

}

printf("\n");

}

getch();

}


9. C program for below Alphabet pattern:

A

BC

DEF

GHIJ

KLMNO

Program:

#include <stdio.h>

#include<conio.h>

void main()

{

int i,j;

char ch='A';

for(i=1;i<=5;i++)

{

for(j=1;j<=i;j++)

{

printf("%c ",ch++);

}

printf("\n");

}

getch();

}

10. C Program for Alphabet pattern below:

A

ABC

ABCDE

ABCDEFG

ABCDEFGI


Program:

#include<stdio.h>

#include<conio.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");

}

getch();

}


11. C Program for below Full Pyramid of *


*

* * *

* * * * *

* * * * * * *

* * * * * * * * *


Program:

#include <stdio.h>

#include<conio.h>

void main()

{

int i, space, k = 0;

for (i = 1; i <= 5; ++i, k = 0)

{

for (space = 1; space <= 5 - i; ++space)

{

printf(" ");

}

while (k != 2 * i - 1)

{

printf("* ");

++k;

}

printf("\n");

}

getch();

}



 
 
 

Recent Posts

See All
Web Designing Solved Paper July 2026

1. निम्नलिखित में से कौन से सी.एस.एस. नियम गलत हैं ? 1. मार्जिन किसी एलिमेंट के बॉर्डर के अंदर स्पेस जोड़ता है। 2. पैडिंग एलिमेंट के बॉर्डर के बाहर स्पेस जोड़ता है। 3. मार्जिन : ऑटो का उपयोग ब्लॉक एलि

 
 
 
Python July 2026 Exam Paper

1. निम्नलिखित में से किस प्रॉब्लम में पुनरावृत्ति प्रक्रिया की आवश्यकता होती है ? a. फैक्टोरियल गणना b. संख्याओं का योग c. डेसिमल को बाइनरी में बदलना d. दो वेरिएबलों का आदान-प्रदान (A) केवल a, b, c

 
 
 

1 Comment


apotw
Apr 14, 2025

Indwin is one of the best platforms for online gambling. The interface is easy to use, and the games are always fun.

Like
bottom of page