Explanation of the Number Pattern Program
This program takes a number of rows from the user and prints a number pattern where each row displays numbers starting from 1 up to the row number. The program uses nested loops to generate this pattern.
The outer loop controls the number of rows, while the inner loop prints the numbers in each row. This creates a triangular numeric pattern. The getch() function is used to pause the screen, which is mainly a Turbo C function.
What the Program Does
- Asks the user to enter the number of rows.
- Uses the outer loop to repeat the pattern line by line.
- The inner loop prints numbers from 1 to the current row number.
- Creates a triangular increasing number pattern.
- Uses getch() to pause (only in Turbo C).
Example Input
Enter the number of row: 5
Example Output
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Summary: This program prints a simple number pattern using nested loops. Each new row increases the number of printed digits, forming a staircase-like numeric structure.
