Practice/fresherInverted Star Pattern
⏱ 00:00
Best: 0/100
Basic Loops & StarsTarget Time: 8 mins

Inverted Star Pattern

Given an integer N, print an inverted right-angled triangle star pattern of N rows where the first row contains N stars and each subsequent row decreases by one star.

Input Format
A single integer N.
Output Format
Print N rows with decrementing counts of stars.
Constraints:1 <= N <= 20
Concepts Required:
Decrementing loopNested loopsLoop boundary conditions
Expected Pattern PreviewASCII Monospace
*****
****
***
**
*

Notice how character spacing and row counts scale systematically based on the input N.

Concrete Examples

Example 1
Input:
5
Output:
*****
****
***
**
*

Explanation: Row 1 has 5 stars, row 2 has 4, ..., row 5 has 1.

← Back to All Challenges