Powers of 11 Number Pattern in C

Beginner
⏱️ 5 min read
📚 Updated: Aug 2025
🎯 2 Code Examples
Math + Loops

What You’ll Learn

How to print a simple pattern where each row is the next power of 11. We start from 1 and multiply by 11 each time.

⭐ Pattern Output

For 5 rows, the pattern looks like this:

Output
1
11
121
1331
14641
1

Complete C Program

This program prints 5 powers of 11 by multiplying the previous result by 11.

c
#include <stdio.h>

int main() {
    int i;
    int res = 1;

    for (i = 1; i <= 5; i++) {
        if (i == 1)
            res = 1;
        else
            res = res * 11;

        printf("%d\n", res);
    }

    return 0;
}

🧠 How It Works

1

Start with 1

res = 1 represents 11^0.

Init
2

Loop for rows

for (i = 1; i <= rows; i++) prints one result per row.

Loop
3

Multiply by 11

From the 2nd row onward, we do res = res * 11.

Update
=

Powers of 11

This generates 11^0 to 11^4 for 5 rows.

2

Variation — User Input Version

Read the number of rows using scanf().

c
#include <stdio.h>

int main() {
    int i;
    int res = 1;
    int rows;

    printf("Enter the number of rows: ");
    scanf("%d", &rows);

    for (i = 1; i <= rows; i++) {
        if (i == 1)
            res = 1;
        else
            res = res * 11;

        printf("%d\n", res);
    }

    return 0;
}

💡 Tips for Enhancement

Try These

  • Switch to long long to print more rows safely (still limited)
  • Compute powers using pow() (careful with floating-point)
  • Print Pascal’s triangle directly for a true coefficient pattern

Avoid

  • Assuming the Pascal-triangle digit trick works for large rows (carry breaks it)
  • Ignoring integer overflow for bigger powers

Key Takeaways

1

Each row is the previous value multiplied by 11.

2

This prints powers 11^0 to 11^(rows-1).

3

The Pascal’s triangle digit resemblance only holds for small rows.

4

Time complexity is O(rows).

❓ Frequently Asked Questions

Because coefficients like 10 or 15 introduce digit carry when written as a single number, so the visual trick stops matching.
It depends on the integer type. With 32-bit int, overflow comes quickly. Use long long for more range, but it’s still finite.
O(rows), since there is one multiplication and one print per row.

Explore More C Number Patterns!

Practice math + loops with more number sequences.

All Number Patterns →
Did you know?

11^4 = 14641. In Pascal’s triangle, row 4 is 1 4 6 4 1 — which matches the digits before carry starts affecting larger rows.

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