Learn C Programming

Lesson 5 of 9 · Loops and Jump Statements

Module 6 · Loops and Jump Statements

Nested Loops, Grids and Patterns

Free with an accountReading

Amara is making a multiplication grid for the classroom wall. Module 3 gave her %3d, a field three characters wide, so the columns will line up.

Checking what this lesson needs for you…

What is inside Nested Loops, Grids and Patterns

  1. A loop inside a loop: one row per outer pass
  2. The trace table: j starts again on every row
  3. The right triangle: the inner bound follows the outer
  4. The number pyramid: count the spaces before you print
  5. break leaves one loop, not both
  6. Count the passes before you run