NestedLoop Program
Description
This program uses several nested loops to print some geometry patterns.Associated Concepts:
Nested loop
Algorithm:
Use a nested loop to print a 12 X 10 pattern of *
Outer loop: number of rows
Inner loop: number of columns
Use another nested loop to print a triangle pattern of *
The first row has one *, the second row has two *, and so on.
Outer loop: number of rows
Inner loop: number of columns
The length of column depends on the row.
Use another nested loop to print a triangle pattern of *
The first row has twelve *, the second row eleven *, and so on.
Outer loop: number of rows
Inner loop: number of columns
The length of column depends on the row.
Outer loop: number of rows
Inner loop: number of columns
Use another nested loop to print a triangle pattern of *
The first row has one *, the second row has two *, and so on.
Outer loop: number of rows
Inner loop: number of columns
The length of column depends on the row.
Use another nested loop to print a triangle pattern of *
The first row has twelve *, the second row eleven *, and so on.
Outer loop: number of rows
Inner loop: number of columns
The length of column depends on the row.