Number Pattern 39-Pyramid pattern in C programming
Contents
hide
In this program, we will see the Pyramid pattern numbers in C programming language. Please look into the program.
1 121 12321 1234321
The C program for Pyramid pattern is as follows:
#include<stdio.h> int main() { int i,j,no_rows; printf("Enter number of rows - "); scanf("%d",&no_rows); for(i=1;i<=no_rows;i++) { for(j=1;j<=i;j++) { printf("%d",j); } for(j=i-1;j>=1;j--) { printf("%d",j); } printf("n"); } getch(); return 0; }