Shape Rule
Start moves
First letter A → E; each row drops the left edge.

Print a triangle where each row starts one letter later but always ends at the same letter (E in the 5-row example): ABCDE, BCDE, CDE, DE, E. Widths go 5, 4, 3, 2, 1. Contrast Program 5 (rows restart at A) and Program 3 (reverse starting letter but still ends at E). Includes a live preview, worked C examples, edge cases, and complexity.
Start moves
First letter A → E; each row drops the left edge.
i++ from A
Start letter advances; row width shrinks.
i..end
Print forward from the start up to a fixed end.
Same widths
Both shrink 5…1; this one moves the left edge.
Rows 1–10
Pick a row count and draw ABCDE…E live.
Complexity
n+(n-1)+…+1 printed characters total.
An increasing-start alphabet triangle keeps a fixed right edge while the left edge walks forward — each row is a shorter suffix of the first row.
In C you raise the start letter with the outer loop (i++) and print from i up to a fixed end with the inner loop.
It pairs with Program 5 to show two ways to shrink a triangle: shorten the end, or advance the start — same widths, different edges.
i from A to end.
j from i up to end.
Every row ends at end.
ABCDE … E
In short: for each start letter i from 'A' to end, print j from i up to end, then call printf("\n").
Given a row count (or fixed end E), print a shrinking triangle where each row is a forward suffix ending at the same letter.
// Five rows (end = E)
// ABCDE
// BCDE
// CDE
// DE
// E | Item | Type | Description |
|---|---|---|
rows / endChar | int / char | Number of rows; end letter is 'A' + rows - 1 (E for 5). |
| Printed output | text | Shrinking forward suffixes from A..end down to end alone. |
end = 'A' + rows - 1
for i from 'A' to end: // start letter advances
for j from i to end: // forward suffix each row
print j
print newline | Approach | Idea | Best for |
|---|---|---|
| Char nested loops | Outer i++, inner j++ from i to end | Matching this classic sample |
| Substring view | Think of each row as alphabet.Substring(start) | When explaining suffixes conceptually |
Three ways to keep a fixed right edge at the top letter.
grow i..endE, DE, CDE — start moves back
shrink A..iABCDE, ABCD — left fixed at A
shrink i..endABCDE, BCDE — right fixed at end
breakEnds the row after i..end finishes
Reach for this when teaching an advancing start bound with a fixed forward end.
Same shrinking widths; move the start instead of the end.
Practice rows that are alphabet suffixes ending at a fixed letter.
Next flips both directions: EDCBA, DCBA, CBA, …
Mix a moving start with a fixed end in the same program.
This is a console teaching pattern — not how you build modern app screens.
Key benefit: one advancing start plus a fixed end is the cleanest way to shrink a triangle from the left while keeping a vertical right edge.
Choose 1–10 rows and draw the increasing-start alphabet 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 rows that always end at E.
EOuter loop picks the starting letter (A to E). Inner loop prints from that start to the fixed end letter (E).
#include <stdio.h>
int main() {
char i, j;
for (i = 'A'; i <= 'E'; i++) {
for (j = i; j <= 'E'; j++) {
printf("%c", j);
}
printf("\n");
}
return 0;
} When i = 'C', the inner loop prints C, D, E → CDE. When i = 'E', it prints only E.
Let the user choose how many rows to print.
Read the number of rows and compute endChar = 'A' + rows - 1. Check scanf in real apps.
#include <stdio.h>
int main() {
int rows;
char endChar, i, j;
printf("Enter the number of rows: ");
scanf("%d", &rows);
endChar = (char)('A' + rows - 1);
for (i = 'A'; i <= endChar; i++) {
for (j = i; j <= endChar; j++) {
printf("%c", j);
}
printf("\n");
}
return 0;
} For 4 rows, endChar becomes 'D'. Cap rows at 26 so endChar 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 endChar = 'E';
char i, j;
for (i = 'A'; i <= endChar; i++) {
for (j = i; j <= endChar; 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 moves from 'A' to end. That means each row starts one letter later.
j starts at i and goes up to end, so every row ends at the same letter.
printf("\n") ends each row.
Because the inner loop always stops at end, every row ends on the same letter while the left side walks forward.
Row lengths sum to n+(n-1)+…+1, so time complexity is O(n²).
Trace each start letter and the resulting forward suffix up to E.
i (start) | Inner range | Printed row |
|---|---|---|
A | A..E | ABCDE |
B | B..E | BCDE |
C | C..E | CDE |
D | D..E | DE |
E | E..E | E |
Row lengths are 5, 4, 3, 2, 1. The right edge is always E.
Where this increasing-start alphabet triangle shows up beyond the homework prompt.
Clearest demo of advancing only the start bound.
Example: start j at A instead and compare with Program 5.
Fixed right edge with a moving left edge.
Example: stack next to Program 5’s fixed A edge.
Practice inclusive ranges from a moving start to a fixed end.
Example: off-by-one if you stop before end.
Map row count to end 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 5 and 7 in the alphabet set.
Example: revisit Program 3.
Pro Tip: say “walk the start forward, keep the end fixed” before coding — that story prevents restarting at A by habit.
Why this pattern earns a spot early in the alphabet-pattern series.
A restarting A or missing E shows up immediately.
Same widths; only which bound moves differs.
Change the end 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 5 first; this page is mostly “same shrinking idea, start at i instead of A.”
Small habits that keep increasing-start alphabet triangles clean.
Starting at 'A' turns this into Program 5.
Both the outer and inner loops share the same end letter.
Forgetting the - 1 makes the first row one letter too long.
Keep the end letter inside A–Z when taking user input.
scanfValidate the row count and check scanf’s return value.
Pro Tip: if you see ABCDE, ABCD, ABC, the inner loop is still starting at A — switch to j = i.
Mistakes that commonly break increasing-start alphabet triangles.
Prints Program 5 instead of ABCDE, BCDE, …
→ Use for (char j = i; j <= endChar; j++).
Produces reverse runs like Program 4 / Program 7.
→ Keep j++ so letters ascend toward the end.
Using 'A' + rows without - 1 overshoots.
→ Use endChar = (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.
ABCDE down to E (Example 1).
ABCD down to D (Example 2).
Cap or reject — end leaves the alphabet.
Check scanf’s return value.
Swap 'A' for 'a' in both loops.
Try these variations to lock in the pattern.
'A'j--i++ moves the left edge forward each row.Quick Takeaway: advance the start letter with the outer loop, then print forward to a fixed end — that alone builds ABCDE, BCDE, …, 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 increasing-start alphabet triangle keeps a fixed end while the start letter walks forward: each row is a shorter suffix of the first. Master the classic ABCDE…E sample, then try user input and the spaced rewrite.
Practice the three examples above, then continue to Alphabet Pattern 7.
Outer i from A to end, inner j from i up to end, then break each line.
i and count up to endendChar = 'A' + rows - 1 for input versions'A' (that becomes Program 5)j-- when you want ABCDE, BCDE, …- 1 in the endChar formulaprintf("\n") inside the letter loopPrint the increasing-start alphabet triangle the beginner-friendly way.
Start advances, end fixed
Definitionj from i to end
CodeEvery row ends at end
ShapeSame widths, left moves
CompareO(n²) time
AnalysisEach row starts one letter later (A, B, C, …), but always prints up to the same end letter. For 5 rows, the output is ABCDE, BCDE, CDE, DE, E.
Changing only one loop bound can transform the entire output.
12 people found this page helpful