C Program to Print the Rectangle Pyramid of Consecutive Numbers !!
C Program to Print the Rectangle Pyramid of Numbers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include<stdio.h> int main() { int number, row, col; printf("\nEnter Number of Rows to be display : "); scanf("%d", &number); for (row = 1; number >= row; row++) { for (col = 1; col <= number; col++) printf("%d\t", row); printf("\n"); } return 0; } |
Output :
1 2 3 4 5 6 | Enter Number of Rows to be display : 5 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 |