Increasing Start Letter Alphabet Triangle in C

Beginner
⏱️ 8 min read
📚 Updated: Aug 2026
🎯 3 Code Examples
🚀 Live Preview
Nested Loops

What You’ll Learn

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.

Shape Rule

Start moves

First letter A → E; each row drops the left edge.

Outer Loop

i++ from A

Start letter advances; row width shrinks.

Inner Loop

i..end

Print forward from the start up to a fixed end.

vs Program 5

Same widths

Both shrink 5…1; this one moves the left edge.

Live Preview

Rows 1–10

Pick a row count and draw ABCDE…E live.

O(n²)

Complexity

n+(n-1)+…+1 printed characters total.

Introduction

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.

Why it matters?

It pairs with Program 5 to show two ways to shrink a triangle: shorten the end, or advance the start — same widths, different edges.

Key Highlights

Outer

i from A to end.

Inner

j from i up to end.

Edge

Every row ends at end.

Output

ABCDE … E

In short: for each start letter i from 'A' to end, print j from i up to end, then call printf("\n").

📝 Problem & Approach

Given a row count (or fixed end E), print a shrinking triangle where each row is a forward suffix ending at the same letter.

c
// Five rows (end = E)
// ABCDE
// BCDE
// CDE
// DE
// E

Inputs & Outputs

ItemTypeDescription
rows / endCharint / charNumber of rows; end letter is 'A' + rows - 1 (E for 5).
Printed outputtextShrinking forward suffixes from A..end down to end alone.

Minimal workflow

Pseudocode
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 comparison

ApproachIdeaBest for
Char nested loopsOuter i++, inner j++ from i to endMatching this classic sample
Substring viewThink of each row as alphabet.Substring(start)When explaining suffixes conceptually

⚡ Quick Reference

GoalPattern
Fixed A–Efor (char i = 'A'; i <= 'E'; i++)
Forward suffixfor (char j = i; j <= 'E'; j++) printf("%c", j);
User rowschar endChar = (char)('A' + rows - 1); then loop i to endChar
Restart at A insteadSee Program 5 (inner starts at A)
Growing reverse startSee Program 3

📋 Prog 3 vs Prog 5 vs Prog 6

Three ways to keep a fixed right edge at the top letter.

Program 3
grow i..end

E, DE, CDE — start moves back

Program 5
shrink A..i

ABCDE, ABCD — left fixed at A

Program 6
shrink i..end

ABCDE, BCDE — right fixed at end

printf("\n")
break

Ends the row after i..end finishes

Context

When This Pattern Shows Up

Reach for this when teaching an advancing start bound with a fixed forward end.

  1. After Program 5

    Same shrinking widths; move the start instead of the end.

  2. Suffix drills

    Practice rows that are alphabet suffixes ending at a fixed letter.

  3. Bridge to Program 7

    Next flips both directions: EDCBA, DCBA, CBA, …

  4. Char arithmetic practice

    Mix a moving start with a fixed end in the same program.

  5. Not a UI layout tool

    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.

🔮 Live Preview

Choose 1–10 rows and draw the increasing-start alphabet triangle in the browser.

Try 5 (classic ABCDE…E) or 4 (ABCD…D). Max 10 keeps the preview readable.

Live result
Press "Draw pattern".

Examples Gallery

Three complete C programs — fixed A–E, scanf row count, and a spaced-letter variant. Click View Output to reveal sample console results.

📚 Getting Started

Print five shrinking rows that always end at E.

Example 1 — Fixed End E

Outer loop picks the starting letter (A to E). Inner loop prints from that start to the fixed end letter (E).

c
#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;
}

How It Works

When i = 'C', the inner loop prints C, D, ECDE. When i = 'E', it prints only E.

📈 Practical Variant

Let the user choose how many rows to print.

Example 2 — Row Count Input

Read the number of rows and compute endChar = 'A' + rows - 1. Check scanf in real apps.

c
#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;
}

How It Works

For 4 rows, endChar becomes 'D'. Cap rows at 26 so endChar stays within A–Z.

⚡ Readability Variant

Same triangle with spaces between letters.

Example 3 — Spaced Letters

Print a trailing space after each letter so columns are easier to scan.

c
#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;
}

How It Works

Loop bounds are unchanged — only the printed unit becomes j + " ". Trim trailing spaces later if you need a compact line.

🧠 How the Algorithm Prints Rows

1

Outer loop chooses the start

i moves from 'A' to end. That means each row starts one letter later.

Start moves right
2

Inner loop runs to a fixed end

j starts at i and goes up to end, so every row ends at the same letter.

Fixed end
3

New line

printf("\n") ends each row.

Line break
4

Right edge stays fixed

Because the inner loop always stops at end, every row ends on the same letter while the left side walks forward.

Alignment
=

Shrinking width

Row lengths sum to n+(n-1)+…+1, so time complexity is O(n²).

🔎 Worked Walkthrough — End = E (5 rows)

Trace each start letter and the resulting forward suffix up to E.

i (start)Inner rangePrinted row
AA..EABCDE
BB..EBCDE
CC..ECDE
DD..EDE
EE..EE

Row lengths are 5, 4, 3, 2, 1. The right edge is always E.

Use Cases

Where this increasing-start alphabet triangle shows up beyond the homework prompt.

1. Suffix Labs

Clearest demo of advancing only the start bound.

Example: start j at A instead and compare with Program 5.

2. Edge Practice

Fixed right edge with a moving left edge.

Example: stack next to Program 5’s fixed A edge.

3. Char Bounds

Practice inclusive ranges from a moving start to a fixed end.

Example: off-by-one if you stop before end.

4. Input Scaling

Map row count to end letter with 'A' + rows - 1.

Example: scale from 5 to 8 without rewriting loops.

5. Complexity Intuition

Triangle sums make O(n²) easy to see.

Example: 15 letters for 5 rows.

6. Series Continuity

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.

Advantages

Why this pattern earns a spot early in the alphabet-pattern series.

  1. 1. Instant Visual Feedback

    A restarting A or missing E shows up immediately.

  2. 2. Clear Pair with Program 5

    Same widths; only which bound moves differs.

  3. 3. Scales Cleanly

    Change the end letter or row count and the whole triangle shrinks from the left.

  4. 4. Beginner-Friendly

    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.”

Usage Tips

Small habits that keep increasing-start alphabet triangles clean.

  1. 1. Start the Inner Loop at i

    Starting at 'A' turns this into Program 5.

  2. 2. Keep the End Bound Fixed

    Both the outer and inner loops share the same end letter.

  3. 3. Set endChar = 'A' + rows - 1

    Forgetting the - 1 makes the first row one letter too long.

  4. 4. Cap Rows at 26

    Keep the end letter inside A–Z when taking user input.

  5. 5. Check scanf

    Validate 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.

Common Pitfalls

Mistakes that commonly break increasing-start alphabet triangles.

  1. 1. Starting the Inner Loop at A

    Prints Program 5 instead of ABCDE, BCDE, …

    → Use for (char j = i; j <= endChar; j++).

  2. 2. Using j-- in the Inner Loop

    Produces reverse runs like Program 4 / Program 7.

    → Keep j++ so letters ascend toward the end.

  3. 3. Wrong endChar Formula

    Using 'A' + rows without - 1 overshoots.

    → Use endChar = (char)('A' + rows - 1).

  4. 4. Unchecked scanf

    Empty or non-numeric input leaves rows unused or uninitialized.

    → Check scanf’s return value and validate range.

  5. 5. Forgetting printf("\n")

    All letters dump onto one line.

    → Call printf("\n") after each inner loop.

Edge Cases

Check these inputs before calling the solution done.

rows = 1

Single letter

Output is just A.

rows = 5

Classic sample

ABCDE down to E (Example 1).

rows = 4

Smaller triangle

ABCD down to D (Example 2).

rows > 26

Past Z

Cap or reject — end leaves the alphabet.

Bad input

Empty / non-numeric

Check scanf’s return value.

Lowercase

abcde … e

Swap 'A' for 'a' in both loops.

🎯 Practice Problems

Try these variations to lock in the pattern.

1. Flip to Program 5

  • Start the inner loop at 'A'
  • Confirm you get ABCDE, ABCD, ABC

2. Compare with Program 3

  • Note growing vs shrinking with a fixed end
  • See Program 3

3. Scale to 8 rows

  • Use the input version
  • Check the first row is ABCDEFGH

4. Reverse along the row

  • Change the inner loop to j--
  • Then continue to Program 7

Notes

  • Start advances. Outer i++ moves the left edge forward each row.
  • The inner loop always stops at end, so the right edge is vertical.
  • Row lengths are n, n-1, …, 1 — same as Program 5, different edges.
  • Next up: Alphabet Pattern 7 reverses letters while shrinking.

Quick Takeaway: advance the start letter with the outer loop, then print forward to a fixed end — that alone builds ABCDE, BCDE, …, E.

⏱️ Time and Space Complexity

ProgramTimeExtra 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²).

Wrap Up

🎉 Conclusion

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.

💡 Best Practices

✅ Do

  • Start the inner loop at i and count up to end
  • Share one end letter across both loops
  • Use endChar = 'A' + rows - 1 for input versions
  • Cap user row counts at 26
  • State O(n²) when asked about complexity

❌ Don’t

  • Start the inner loop at 'A' (that becomes Program 5)
  • Use j-- when you want ABCDE, BCDE, …
  • Forget the - 1 in the endChar formula
  • Skip validating row-count input
  • Call printf("\n") inside the letter loop

Key Takeaways

Knowledge Unlocked

Five things to remember about this alphabet pattern

Print the increasing-start alphabet triangle the beginner-friendly way.

5
Core concepts
= 02

Inner

j from i to end

Code
1 03

Edge

Every row ends at end

Shape
R 04

vs Prog 5

Same widths, left moves

Compare
O 05

Complexity

O(n²) time

Analysis

❓ Frequently Asked Questions

The outer loop picks the starting letter (A, then B, then C…). The inner loop prints from that start up to the fixed end letter (E in the 5-row example). Each row drops the leftmost character and becomes shorter.
Program 5 restarts each row at A and shortens the end letter (ABCDE, ABCD, …). Program 6 shifts the start letter forward each row while keeping the same end letter (ABCDE, BCDE, …).
Program 3 grows while starting earlier (E, DE, CDE). This pattern shrinks while starting later (ABCDE, BCDE, CDE). Both keep a fixed right edge at the top letter.
Because the inner loop always stops at the same end letter ('E'), so the last printed character is fixed.
O(n²) for n rows, because total printed characters are n(n+1)/2.
Yes. Read rows with scanf, set endChar = (char)('A' + rows - 1), then loop i from 'A' to endChar and print j from i up to endChar.
Check scanf("%d", &rows) == 1, require n ≥ 1, and cap at 26 so the end letter stays within A–Z.
Yes. Use 'a' as the base: endChar = (char)('a' + rows - 1), then loop the same way with j++ from i up to endChar.

Did you Know? 🔊

Each 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.

Explore More C Alphabet Patterns!

Changing only one loop bound can transform the entire output.

All Alphabet Patterns →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful