Number Pattern 58-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.
1 2 3 4 5 2 1 2 3 4 3 2 1 2 3 4 3 2 1 2 5 4 3 2 1
The C program for Pyramid pattern is as follows:
#include <stdio.h> int main () { int a,b,c; for (a=1;a<=5;a++) { for(c=a;c>1;c--) printf("%d ",c); for(b=1;b<=6-a;b++) printf("%d ",b); printf("n"); } getch(); return 0; }