Number Pattern 53-Rectangle pattern in C programming
Contents
hide
In this program, we will see the Rectangle pattern numbers in C programming language. Please look into the program.
5432* 543*1 54*21 5*321 *4321
The C program for Pyramid pattern is as follows:
#include<stdio.h> int main() { int a, b, no_rows; printf("Enter number of rows - "); scanf("%d",&no_rows); for(a=1;a<=no_rows;a++) { for(b=no_rows;b>=1;b--) { if(a==b) printf("*"); else printf("%d",b); } printf("n"); } getch(); return 0; }