![]() |
VOOZH | about |
Pyramid patterns is a classic logical programming exercise where a triangular looking pattern is printed by treating the output screen as a matrix and printing a given character. In this article, we will explore how to print various alphabet pyramid patterns using C program.
Half Pyramid Pattern is a triangular pattern where each row starts with 'A' and increases by one character per row. Characters are aligned to the left resembling a right-angled triangle with the hypotenuse facing right.
A A B A B C A B C D A B C D E
Inverted half pyramid pattern is nothing but the half pyramid pattern flipped vertically.
A B C D E A B C D A B C A B A
The Full Pyramid Pattern looks like an equilateral triangle pattern where each row increases the number of characters by 2 from the top to the bottom row.
A A B C A B C D E A B C D E F G A B C D E F G H I
The Hollow Pyramid Pattern forms a full pyramid where only the outer edges are filled with characters and the inner part of the pyramid is empty, creating a hollow space inside the shape.
A A C A E A G A B C D E F G H I
The Diamond Pyramid Pattern can be considered as made up of two halves. The top half is a regular pyramid with increasing characters and the bottom half is an inverted pyramid with decreasing characters forming a diamond-like shape.
A A B C A B C D E A B C D E F G A B C D E F G H I A B C D E F G A B C D E A B C A