C++ Program To Print Inverted Hollow Star Pyramid Pattern

Last Updated : 18 Aug, 2026

An inverted hollow star pyramid is a pattern where the first row contains stars across the entire width, while the following rows contain stars only at the boundaries. The remaining positions are filled with spaces, creating a hollow structure that narrows toward the bottom.

  • The number of leading spaces increases by one after every row.
  • The number of positions decreases by two in each successive row.

Illustration

Input:

R = 5

Output:

******
* *
* *
* *
*

For R = 10, the pattern becomes:

***********
* *
* *
* *
* *
* *
* *
* *