Shape Rule
Fixed left
Every row starts at E; the right edge moves left.

Print a reverse triangle where every row begins with the same top letter (E in the 5-row example) and becomes shorter each line: EDCBA, EDCB, EDC, ED, E. Compare Program 7 (the first letter changes each row) and Program 5 (forward prefixes from A). Includes a live preview, worked Java examples, edge cases, and complexity.
Fixed left
Every row starts at E; the right edge moves left.
i++ floor
Raises the stop letter A → E to shorten tails.
top..i
Always starts at top; counts down to the floor.
Same widths
Both shrink 5…1; this one keeps E on the left.
Rows 1–10
Pick a row count and draw EDCBA…E live.
Complexity
n+(n-1)+…+1 printed characters total.
A fixed-start reverse alphabet triangle keeps a vertical left edge at the top letter while each row clips one more character from the right.
In Java you raise a floor with the outer loop (i++) and always print from top down to that floor with the inner loop.
It pairs with Program 7 to show two reverse shrinking styles: move the start, or keep the start fixed and raise the stop — same widths, different edges.
i from A to top.
j from top down to i.
Every row starts at top.
EDCBA … E
In short: for each floor letter i from 'A' to top, print j from top down to i, then call println().
Given a row count (or fixed top E), print a shrinking reverse triangle where every row begins at the same top letter.
// Five rows (top = E)
// EDCBA
// EDCB
// EDC
// ED
// E | Item | Type | Description |
|---|---|---|
rows / top | int / char | Number of rows; top letter is 'A' + rows - 1 (E for 5). |
| Printed output | text | Shrinking reverse prefixes from top..A down to top alone. |
top = 'A' + rows - 1
for i from 'A' to top: // raise the floor
for j from top down to i: // reverse from fixed start
print j
print newline | Approach | Idea | Best for |
|---|---|---|
| Char nested loops | Outer i++, inner j-- from top to i | Matching this classic sample |
| Clip from the right | Think of each row as a shorter reverse prefix of EDCBA | When explaining tails conceptually |
Three shrinking triangles — different fixed edges and letter directions.
A..i shrinkABCDE, ABCD — left fixed at A
i..A shrinkEDCBA, DCBA — right fixed at A
top..i shrinkEDCBA, EDCB — left fixed at top
breakEnds the row after top..i finishes
Reach for this when teaching a fixed reverse start with a rising stop bound.
Keep reverse letters; pin the first character and clip the tail.
Practice reverse prefixes that always begin at the same letter.
Next switches to repeating letters: A, BB, CCC, …
Mix i++ with j-- in the same program.
This is a console teaching pattern — not how you build modern app screens.
Key benefit: one fixed reverse start plus a rising floor is the cleanest way to shrink a reverse triangle while keeping a vertical left edge.
Choose 1–10 rows and draw the fixed-start reverse alphabet triangle in the browser.
Three complete Java programs — fixed A–E, user-chosen row count, and a spaced-letter variant. Click View Output to reveal sample console results.
Print five shrinking reverse rows that always start at E.
EOuter loop raises the stopping letter; inner loop always starts at E and counts down.
public class FixedStartReverseTriangle {
public static void main(String[] args) {
for (char i = 'A'; i <= 'E'; i++) {
for (char j = 'E'; j >= i; j--) {
System.out.print(j);
}
System.out.println();
}
}
} When i = 'C', the inner loop prints E, D, C → EDC. When i = 'E', it prints only E.
Let the user choose how many rows to print.
Read the number of rows and compute top = 'A' + rows - 1. Prefer checking hasNextInt() before nextInt() in real apps.
import java.util.Scanner;
public class FixedStartReverseTriangleInput {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the number of rows: ");
int rows = sc.nextInt();
char top = (char) ('A' + rows - 1);
for (char i = 'A'; i <= top; i++) {
for (char j = top; j >= i; j--) {
System.out.print(j);
}
System.out.println();
}
sc.close();
}
} 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.
public class FixedStartReverseTriangleSpaced {
public static void main(String[] args) {
char top = 'E';
for (char i = 'A'; i <= top; i++) {
for (char j = top; j >= i; j--) {
System.out.print(j + " ");
}
System.out.println();
}
}
} Loop bounds are unchanged — only the printed unit becomes j + " ". Trim trailing spaces later if you need a compact line.
i runs from 'A' to top. It sets how far down the inner loop should go on that row.
j starts at top on every row, so the first printed character is always that letter (E for five rows).
The condition j >= i makes the row shorter each time: when i is A, you print down to A; when i is E, you print only E.
Because the inner loop always starts at top, every row begins on the same letter while the right edge moves left.
Outer i++ and inner j-- together control the clipping. Total work is still O(n²).
Trace each floor letter and the resulting reverse prefix from E.
i (floor) | Inner range | Printed row |
|---|---|---|
A | E..A | EDCBA |
B | E..B | EDCB |
C | E..C | EDC |
D | E..D | ED |
E | E..E | E |
Row lengths are 5, 4, 3, 2, 1. The left edge is always E.
Where this fixed-start reverse alphabet triangle shows up beyond the homework prompt.
Clearest demo of raising only the stop bound.
Example: start j at i instead and compare with Program 7.
Fixed left edge with a moving right edge.
Example: stack next to Program 5’s fixed A edge.
Practice inclusive ranges from a fixed top down to a rising floor.
Example: off-by-one if you stop before i.
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 7 and 9 in the alphabet set.
Example: revisit Program 2.
Pro Tip: say “always start at top, raise the floor” before coding — that story prevents starting at i by habit.
Why this pattern earns a spot early in the alphabet-pattern series.
A moving first letter or full-width rows show up immediately.
Same reverse shrinking; only which edge stays fixed differs.
Change the top letter or row count and the whole triangle clips from the right.
No padding or diagonal checks — just two char loops.
Pro Tip: master Program 7 first; this page is mostly “same reverse idea, always start at top and raise the floor.”
Small habits that keep fixed-start reverse alphabet triangles clean.
Starting at i turns this into Program 7.
Using j >= 'A' prints full width every row.
Forgetting the - 1 makes the first row one letter too long.
Keep the top letter inside A–Z when taking user input.
hasNextInt()Validate the row count with hasNextInt() before nextInt().
Pro Tip: if you see EDCBA, DCBA, CBA, the inner loop is starting at i — switch to start at top.
Mistakes that commonly break fixed-start reverse alphabet triangles.
Prints Program 7 instead of EDCBA, EDCB, …
→ Use for (char j = top; j >= i; j--).
Using j >= 'A' prints full EDCBA each time.
→ Keep the condition j >= i.
Using 'A' + rows without - 1 overshoots.
→ Use top = (char)('A' + rows - 1).
nextInt()Letters or empty input throw InputMismatchException.
→ Check hasNextInt() and re-prompt on failure.
All letters dump onto one line.
→ Call System.out.println() after each inner loop.
Check these inputs before calling the solution done.
Output is just A.
EDCBA down to E (Example 1).
DCBA down to D (Example 2).
Cap or reject — top leaves the alphabet.
Check hasNextInt() before nextInt().
Swap 'A' for 'a' in both loops.
Try these variations to lock in the pattern.
ij >= 'A' oncei++ shortens each row from the right.Quick Takeaway: always start at the top letter, then raise the floor with the outer loop — that alone builds EDCBA, EDCB, …, E.
| 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 fixed-start reverse alphabet triangle keeps a vertical left edge at the top letter while the floor rises A…E to clip the tail. Master the classic EDCBA…E sample, then try user input and the spaced rewrite.
Practice the three examples above, then continue to Alphabet Pattern 9.
Outer i from A to top, inner j from top down to i, then break each line.
top every rowi (not always at A)top = 'A' + rows - 1 for input versionsi (that becomes Program 7)j >= 'A' when you want shrinking rows- 1 in the top formulaprintln inside the letter loopPrint the fixed-start reverse alphabet triangle the beginner-friendly way.
Fixed start, rising floor
Definitionj from top to i
CodeEvery row starts at top
ShapeSame widths, left fixed
CompareO(n²) time
AnalysisEvery row begins with 'E' (in the 5-row example) because the inner loop always starts from that top letter. The outer loop only increases the stopping point, so the tail gets shorter: EDCBA, EDCB, EDC, ED, E.
Fixing one corner and sliding loop bounds is a great way to invent new patterns.
12 people found this page helpful