![]() |
VOOZH | about |
An Inverted Pyramids are inverted triangular patterns where the base is at the top, and the rows decrease in size as they move downwards. In this article, we will learn how to print different types of inverted pyramid patterns using C program.
There can be 3 types of inverted pyramid patterns:
The Inverted Right Half Pyramid Pattern is a triangular pattern where the largest row is at the top and the number of characters in a row decreases as we move downwards. Each row is aligned to the left, resembling inverted right-angle triangle with its hypotenuse in right direction.
Output
* * * * * | 1 2 3 4 5 | A B C D E
* * * * | 1 2 3 4 | A B C D
* * * | 1 2 3 | A B C
* * | 1 2 | A B
* | 1 | A
Explanation:
The Inverted Left Half Pyramid Pattern is a triangular pattern similar to the right half pyramid, but the characters are aligned to the right instead of left.
Output
* * * * * | 1 2 3 4 5 | A B C D E
* * * * | 1 2 3 4 | A B C D
* * * | 1 2 3 | A B C
* * | 1 2 | A B
* | 1 | A
Explanation:
i increases.The Inverted Full Pyramid Pattern is a variation of the pyramid pattern where the largest row is at the top, and the number of characters decreases as we move downward. It is basically the inverted equilateral triangle.
Output
* * * * * * * * * | 1 2 3 4 5 6 7 8 9 | A B C D E F G H I
* * * * * * * | 1 2 3 4 5 6 7 | A B C D E F G
* * * * * | 1 2 3 4 5 | A B C D E
* * * | 1 2 3 | A B C
* | 1 | A
Explanation: