Shape Rule
Growing reverse rows
Row k prints k letters from top down to a row end letter.

Print a reverse alphabet right-angled triangle: each row has one more character than the previous, and letters go from a top letter down toward A — E, ED, EDC, EDCB, EDCBA. Same geometry as Program 1, but descending along the alphabet. Includes a live preview, worked C examples, edge cases, and complexity.
Growing reverse rows
Row k prints k letters from top down to a row end letter.
Row end letter
for (char i = top; i >= 'A'; i--) picks the last letter.
Always from top
j starts at top and prints down to i.
j--
Decrementing a char walks the alphabet backward.
1–10 rows
Pick a height and draw the reverse triangle instantly.
Complexity
Triangular letter count: n(n+1)/2 writes.
A reverse alphabet right-angled triangle grows like Program 1, but every row starts at a fixed top letter and counts downward until a row-specific end letter.
In C you solve it with nested char loops: the outer loop walks the end letter from top down to A, and the inner loop always restarts at top and prints down to that end.
It locks in reverse character iteration — the same j-- skill used in many reverse triangles, diagonals, and mirrored alphabet labs.
1, 2, 3, … letters per row.
Inner loop restarts at the top letter.
Print with j-- down to the end.
Same triangle; opposite letter direction.
In short: reset ch to the top letter each row (or loop j from top down to the row end), print with printf("%c", …), then printf("\n").
Given a row count n (or fixed A–E), print a left-aligned triangle of descending alphabet prefixes.
// Five rows (top = E)
// E
// ED
// EDC
// EDCB
// EDCBA | Item | Type | Description |
|---|---|---|
rows / top | int / char | Number of rows, or top letter where top = 'A' + rows - 1. |
| Printed output | text | Growing reverse prefixes from top down to A on the last row. |
top = 'A' + rows - 1
for i from top down to 'A':
for j from top down to i:
print j
print newline | Approach | Idea | Best for |
|---|---|---|
| Char loops down | Outer/inner both decrement | Matching this classic sample |
| Index + char array | Walk indices into A..Z | When you already think in 0-based rows |
| Goal | Pattern |
|---|---|
| Top letter | char top = (char)('A' + rows - 1); |
| Outer (end letter) | for (char i = top; i >= 'A'; i--) |
| Inner (print) | for (char j = top; j >= i; j--) printf("%c", j); |
| End the row | printf("\n"); |
| Forward triangle | See Program 1 |
| Lowercase | Use 'a' as the base instead of 'A' |
Same triangle idea as Program 1 — only letter direction changes.
letterPrints each descending letter on the current row
breakEnds the row after the reverse run finishes
E..downLetters count down from top each row
A..upLetters count up from A each row
Reach for this when teaching reverse character loops on a growing triangle.
Keep the triangle; flip letter direction to descending.
Practice j-- and j >= i bounds safely.
Next you change only the starting letter while counting forward.
Practice top = 'A' + rows - 1 for any height.
This is a console teaching pattern — not how you build modern app screens.
Key benefit: one bound change (j >= i with j--) turns a forward triangle into a reverse one.
Choose between 1 and 10 rows and draw the reverse alphabet triangle in the browser.
Three complete C programs — fixed top E, scanf row count, and spaced letters. . Click View Output to reveal sample console results.
Print five reverse rows with nested char loops.
EEach row resets ch = 'E', then prints i letters with printf("%c", ch--).
#include <stdio.h>
int main() {
int i, j;
char ch;
for (i = 1; i <= 5; ++i) {
ch = 'E';
for (j = 1; j <= i; ++j) {
printf("%c", ch--);
}
printf("\n");
}
return 0;
} When row length is 3, ch prints E, D, C → EDC. When row length is 5, it prints the full reverse run EDCBA. Equivalent bound style: loop j from 'E' down to the row end letter.
Let the user choose how many rows to print.
Read the number of rows and set ch = 'A' + rows - 1 at the start of each row. Check scanf in real apps.
#include <stdio.h>
int main() {
int rows;
int i, j;
char ch;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (i = 1; i <= rows; ++i) {
ch = (char)('A' + rows - 1);
for (j = 1; j <= i; ++j) {
printf("%c", ch--);
}
printf("\n");
}
return 0;
} For 4 rows, each row starts at 'D'. Cap rows at 26 so the top letter stays within A–Z.
Same reverse 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 = top; j >= i; --j) {
printf("%c ", j);
}
printf("\n");
}
return 0;
} Loop bounds are unchanged — only the printed unit becomes printf("%c ", j). Trim trailing spaces later if you need a compact line.
Grow width with i = 1..rows (or run i from top down to 'A'). Reset ch to the top letter each row.
Reset ch to top and print with printf("%c", ch--) (or loop j from top down to the row end).
printf("\n") ends the current row and moves to the next line.
Rows grow by one letter each time until the full reverse run prints.
You print 1+2+…+n letters — O(n²) time, O(1) extra memory.
ETrace each outer value of i and the letters printed on that row.
i (end) | Inner j range | Printed row |
|---|---|---|
E | E..E | E |
D | E..D | ED |
C | E..C | EDC |
B | E..B | EDCB |
A | E..A | EDCBA |
Total letters: 1 + 2 + 3 + 4 + 5 = 15 = 5×6/2.
Where this reverse triangle (and its descending loops) shows up beyond the homework prompt.
Clearest alphabet demo of counting letters downward.
Example: flip bounds to Program 1 and compare.
Same triangle geometry — forward vs reverse fill.
Example: print both side by side for n = 5.
Practice computing top from a row count.
Example: rows 1..10 map to A..J.
Add separators without changing loop structure (Example 3).
Example: print printf("%c ", j) for readable columns.
Triangular sums make O(n²) easy to see.
Example: 5 rows print 15 letters total.
Practice limiting input so top stays in A–Z.
Example: reject rows > 26 or clamp it.
Pro Tip: say “always start at top, stop at the row end letter” before coding — that story prevents wrong inner bounds.
Why this pattern earns a spot right after the forward alphabet triangle.
Wrong direction or bounds show up immediately as a non-reverse triangle.
Same structure; only loop direction and comparison flip.
C char arithmetic makes reverse walks feel natural.
Streaming output needs no storage beyond loop variables.
Pro Tip: master Program 1 first; treat this page as the same story with arrows reversed.
Small habits that keep reverse-triangle code clean.
Every row starts from the same top letter; only the end changes.
j >= i with j--That pair is what produces E, ED, EDC, …
scanfAvoid crashes when the user types letters instead of a number.
Beyond Z you need a wrap/stop policy for top.
Trace E D C on paper before coding larger n.
Pro Tip: if every row starts with a different letter and runs forward to E, you wrote Program 3 — not this pattern.
Mistakes that commonly break reverse alphabet triangles.
Writing j = 'A'; j <= i; j++ prints Program 1 instead.
→ Use j = top; j >= i; j--.
j > i skips the end letter on every row.
→ Keep j >= i so the row end letter is included.
Large rows makes top walk past Z.
→ Cap input at 26 or define a wrap policy.
scanfLetters or empty input leave rows uninitialized.
→ Check scanf’s return value and re-prompt on failure.
printf("\n")All letters print on one continuous line.
→ Call printf("\n") after each inner loop finishes.
Check these inputs before calling the solution done.
Output is just A.
Through EDCBA.
Top is D → D…DCBA.
Reject, clamp, or wrap — decide explicitly.
Unchecked scanf fails silently — check the return value.
Same loops with 'a' as the base.
Try these variations to lock in the pattern.
printf("%c ", j) (Example 3)*top = (char)('A' + rows - 1) to generalize any height.Quick Takeaway: start every row at the top letter, print down to the row end, then break the line — that is the whole triangle.
| Program | Time | Extra space |
|---|---|---|
| Fixed / input (Examples 1–2) | O(n²) | O(1) |
| Spaced letters (Example 3) | O(n²) | O(1) |
Row k prints k letters; summing 1..n gives n(n+1)/2 character writes.
The reverse alphabet right-angled triangle is a small nested-loop exercise with lasting payoff: fixed top letter, descending inner walk, and growing row length. Master the classic E…EDCBA sample, then try user input and optional spacing.
Practice the three examples above, then continue to Program 3’s triangle where each row starts one letter earlier but still runs forward.
Compute a top letter, print top..i on each row, and break only after the inner loop finishes.
top every rowj >= i with j-- for descending outputtop = (char)('A' + rows - 1)scanf and cap at 26printf("\n") after each rowrows exceed 26 without a policyscanfPrint the reverse alphabet right-angled triangle the beginner-friendly way.
Growing reverse prefixes
DefinitionInner always starts here
Codej-- down to i
CodeEnds each row
I/OO(n²) time
AnalysisThis reverse right-angled alphabet triangle prints letters from a top letter down to A on each row. For 5 rows, the output is E, ED, EDC, EDCB, and EDCBA. In C, ch-- or looping j from top down to i both walk the alphabet backward.
Next up: reverse starting letter patterns with nested loops.
12 people found this page helpful