Number Pattern 54-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.
11111 1 1 1 1 1 1 11111
The C program for Pyramid pattern is as follows:
#include<stdio.h> int main() { int a,b; for(a=1;a<=5;a++) { for(b=1;b<=5;b++) { if(b==5 || b==1 || a==1 || a==5) printf("1"); else printf(" "); } printf("n"); } getch(); return 0; }