Search⌘ K

Example 31: Number Pattern

Explore how to use nested loops in C to generate a number pattern where each line contains an increasing count of numbers. Understand loop control and spacing to form a triangular output, enhancing your ability to manage loops for pattern printing.

We'll cover the following...

Problem

Write a program to produce the following output:

1
2   3
4   5  6
7   8  9  10

Try it yourself

Try to solve ...