Pattern 37: Number pattern program in C using for loops
Triangle Pattern in C Language:
Program to print below Triangle Pattern in C on the console using the loops.
Here are couple of example outputs
Example 1:
Enter how many rows you want : 5
1 1 1 1 1
2 2 2 2
3 3 3
4 4
5
Example 2:
Enter how many rows you want : 10
1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3
4 4 4 4 4 4 4
5 5 5 5 5 5
6 6 6 6 6
7 7 7 7
8 8 8
9 9
10
📢 Collection of Pattern Program:
Triangle Pattern in C Program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#include<stdio.h> int main() { int i,j,n; printf("Enter how many rows you want : "); scanf("%d", &n); for(i=1;i<=n;i++) { for(j=i;j<=n;j++) printf(" %d",i); printf("\n"); } return 0; } |
Program Output:
Similar Number Patterns:
- Basic Number Pattern program.
- Triangle Number pattern using for loops.
- Number Pattern 3.
- C Program to print below pattern
- 5 4 3 2 1
5 4 3 2
5 4 3
5 4
5 - C Program to print below pattern.
- 1
2 3
4 5 6
7 8 9 10 - C Program to print Below Pattern,
- 5
4 5
3 4 5
2 3 4 5
1 2 3 4 5 - C Program to print below pattern.
- 1
2 1
3 2 1
4 3 2 1
5 4 3 2 1 - C Program to print below pattern.
- 5
5 4
5 4 3
5 4 3 2
5 4 3 2 1
- C Program to print below Number pattern.
- 1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
- C Program to print below Number pattern.
- 5
4 4
3 3 3
2 2 2 2
1 1 1 1 1
- CLICK here for the Below Pattern
- 5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
Similar Star pattern programs :
- Basic star pattern program (The square pattern with stars).
- Triangle star pattern program.
- Triangle star pattern program with Spaces.
- Pyramid star pattern.
- Reverse Pyramid program.
- Diamond Star pattern program.
- star pattern program.
- K-Star pattern program.
- Empty Rhombus program.
- X-Star pattern program
- More Star Patterns
111111 11111
2222 2222
333 333
44 44
5 5
I want the program
11111111
0000000
*********
11111111
000000