Shape Rule
Rows shrink
First letter E → A; each row drops the left edge.

Print a triangle where the first row is the full reverse run from 'E' down to 'A', and each next row becomes shorter: EDCBA, DCBA, CBA, BA, A. This is the reverse-direction companion to Program 6 (ABCDE, BCDE, … ending at E). Compare also with Program 8. Includes a live preview, worked C examples, edge cases, and complexity.
Rows shrink
First letter E → A; each row drops the left edge.
i-- from top
Start letter lowers; row width shrinks.
i..A
Print backward from the start down to A.
Mirror
Same widths; letters run reverse to A.
Rows 1–10
Pick a row count and draw EDCBA…A live.
Complexity
n+(n-1)+…+1 printed characters total.
A reverse alphabet decreasing triangle keeps a fixed right edge at A while the left edge walks backward — each row is a shorter reverse run toward A.
In C you lower the start letter with the outer loop (i--) and print from i down to 'A' with the inner loop.
It pairs with Program 6 to show that flipping only letter direction turns forward suffixes into reverse runs with the same shrinking geometry.
i from top down to A.
j from i down to A.
Every row ends at A.
EDCBA … A
In short: for each start letter i from top down to 'A', print j from i down to 'A', then call printf("\n").
Given a row count (or fixed top E), print a shrinking triangle where each row is a reverse run ending at A.
// Five rows (top = E)
// EDCBA
// DCBA
// CBA
// BA
// A | Item | Type | Description |
|---|---|---|
rows / top | int / char | Number of rows; top letter is 'A' + rows - 1 (E for 5). |
| Printed output | text | Shrinking reverse runs from top..A down to A alone. |
top = 'A' + rows - 1
for i from top down to 'A': // start letter lowers
for j from i down to 'A': // reverse run each row
print j
print newline | Approach | Idea | Best for |
|---|---|---|
| Char nested loops | Outer i--, inner j-- from i to A | Matching this classic sample |
| Mirror of Program 6 | Same bounds as Program 6 but count down instead of up | When teaching direction flips |
Three reverse-friendly triangles with different growth and edges.
grow i..AA, BA, CBA — growing reverse
shrink i..endABCDE, BCDE — forward suffixes
shrink i..AEDCBA, DCBA — reverse to A
breakEnds the row after i..A finishes
Reach for this when teaching a lowering start bound with a descending letter run to A.
Keep the shrinking start idea; flip letter direction to reverse.
Practice reverse runs that always end at the same letter.
Next keeps E fixed on the left: EDCBA, EDCB, EDC, …
Mix i-- with j-- in the same program.
This is a console teaching pattern — not how you build modern app screens.
Key benefit: one lowering start plus a descending inner loop is the cleanest way to shrink a reverse alphabet triangle with a fixed A on the right.
Choose 1–10 rows and draw the reverse alphabet decreasing triangle in the browser.
Three complete C programs — fixed A–E, scanf row count, and a spaced-letter variant. Click View Output to reveal sample console results.
Print five shrinking reverse rows that always end at A.
EOuter loop chooses the starting letter (E down to A). Inner loop prints from that start down to A.
#include <stdio.h>
int main() {
char i, j;
for (i = 'E'; i >= 'A'; i--) {
for (j = i; j >= 'A'; j--) {
printf("%c", j);
}
printf("\n");
}
return 0;
} When i = 'C', the inner loop prints C, B, A → CBA. When i = 'A', it prints only A.
Let the user choose how many rows to print.
Read the number of rows and compute top = 'A' + rows - 1. Check scanf in real apps.
#include <stdio.h>
int main() {
int rows;
char top, i, j;
printf("Enter the number of rows: ");
scanf("%d", &rows);
top = (char)('A' + rows - 1);
for (i = top; i >= 'A'; i--) {
for (j = i; j >= 'A'; j--) {
printf("%c", j);
}
printf("\n");
}
return 0;
} For 4 rows, top becomes 'D'. Cap rows at 26 so top stays within A–Z.
Same triangle with spaces between letters.
Print a trailing space after each letter so columns are easier to scan.
#include <stdio.h>
int main() {
char top = 'E';
char i, j;
for (i = top; i >= 'A'; i--) {
for (j = i; j >= 'A'; j--) {
printf("%c ", j);
}
printf("\n");
}
return 0;
} Loop bounds are unchanged — only the printed unit becomes j + " ". Trim trailing spaces later if you need a compact line.
i runs from top down to 'A'. That is the first letter on each row.
j runs from i down to 'A', so each row prints reverse alphabetical order.
printf("\n") ends each row.
Because the inner loop always stops at 'A', every row ends on A while the left side walks backward.
Total printed characters are n+(n-1)+…+1, so time complexity is O(n²).
Trace each start letter and the resulting reverse run down to A.
i (start) | Inner range | Printed row |
|---|---|---|
E | E..A | EDCBA |
D | D..A | DCBA |
C | C..A | CBA |
B | B..A | BA |
A | A..A | A |
Row lengths are 5, 4, 3, 2, 1. The right edge is always A.
Where this reverse decreasing alphabet triangle shows up beyond the homework prompt.
Clearest demo of flipping Program 6 to reverse.
Example: change j-- to j++ and compare with Program 6.
Fixed right edge at A with a moving left edge.
Example: stack next to Program 6’s fixed E edge.
Practice inclusive descending ranges ending at 'A'.
Example: off-by-one if you stop at 'B'.
Map row count to top letter with 'A' + rows - 1.
Example: scale from 5 to 8 without rewriting loops.
Triangle sums make O(n²) easy to see.
Example: 15 letters for 5 rows.
Sits between Programs 6 and 8 in the alphabet set.
Example: revisit Program 4.
Pro Tip: say “lower the start, then walk down to A” before coding — that story prevents writing a forward inner loop by habit.
Why this pattern earns a spot early in the alphabet-pattern series.
A forward row or missing A shows up immediately.
Same shrinking start; only letter direction differs.
Change the top letter or row count and the whole triangle shrinks from the left.
No padding or diagonal checks — just two char loops.
Pro Tip: master Program 6 first; this page is mostly “same outer idea, count the letters down instead of up.”
Small habits that keep reverse decreasing alphabet triangles clean.
Use j >= 'A' so every row still ends with A.
Starting at a fixed top letter turns this into Program 8.
Forgetting the - 1 makes the first row one letter too long.
Keep the top letter inside A–Z when taking user input.
scanfValidate the row count and check scanf’s return value.
Pro Tip: if you see ABCDE, BCDE, CDE, the inner loop is still incrementing — switch to j--.
Mistakes that commonly break reverse decreasing alphabet triangles.
Prints Program 6 instead of EDCBA / DCBA.
→ Use for (char j = i; j >= 'A'; j--).
Produces Program 8-style fixed-start rows (EDCBA, EDCB, …).
→ Always start at j = i.
Using 'A' + rows without - 1 overshoots.
→ Use top = (char)('A' + rows - 1).
scanfEmpty or non-numeric input leaves rows unused or uninitialized.
→ Check scanf’s return value and validate range.
printf("\n")All letters dump onto one line.
→ Call printf("\n") after each inner loop.
Check these inputs before calling the solution done.
Output is just A.
EDCBA down to A (Example 1).
DCBA down to A (Example 2).
Cap or reject — top leaves the alphabet.
Check scanf’s return value.
Swap 'A' for 'a' in both loops.
Try these variations to lock in the pattern.
j++i++ from A with inner j--i-- moves the left edge backward each row.'A', so the right edge is vertical.Quick Takeaway: lower the start letter with the outer loop, then walk down to A with the inner loop — that alone builds EDCBA, DCBA, …, A.
| Program | Time | Extra space |
|---|---|---|
| Inline / input (Examples 1–2) | O(n²) | O(1) |
| Spaced letters (Example 3) | O(n²) | O(1) |
For n rows you print n+(n-1)+…+1 = n(n+1)/2 characters, so total work is O(n²).
The reverse alphabet decreasing triangle keeps a fixed A on the right while the start letter walks backward: each row is a shorter reverse run. Master the classic EDCBA…A sample, then try user input and the spaced rewrite.
Practice the three examples above, then continue to Alphabet Pattern 8.
Outer i from top down to A, inner j from i down to A, then break each line.
top and count down to 'A'i and count down to 'A'top = 'A' + rows - 1 for input versionsj++ when you want EDCBA / DCBA- 1 in the top formulaprintf("\n") inside the letter loopPrint the reverse alphabet decreasing triangle the beginner-friendly way.
Start lowers, letters descend
Definitionj from i to A
CodeEvery row ends at A
ShapeSame widths, reverse
CompareO(n²) time
AnalysisThis triangle prints reverse letters and shrinks each row: EDCBA, DCBA, CBA, BA, A. Both loops run backward so letters move toward 'A' on every line.
Reverse loops are just as useful as forward loops for pattern printing.
12 people found this page helpful