Number Pattern 27-Pyramid pattern of numbers in C programming
In this program, we will see the pyramid pattern or triangle of numbers in C programming language. Please look into the program.
1 232 34543 4567654 567898765
The C program for pyramid pattern of numbers is as follows:
#include <stdio.h> int main() { int i, j,k, no_rows; printf("Enter number of rows - "); scanf("%d",&no_rows); for(i=1;i<=no_rows;i++) { j=i; for(k=1;k<=i;k++) { printf("%d",j++); } j-=2; for(k=j;k>=i;k--) { printf("%d",j--); } printf("n"); } getch(); return 0; }