Accourding to me, any patterns are designed with use of for loop, And it is a Simple way to print any patterns. Any patterns are designed by the Combinations of any for loop and any other loops or conditions.
C programming code of patterns
#include<stdio.h>
#include<conio.h>
void main()
{
int n, i, j;
clrscr();
printf("\n Enter the number of rows in pyramid ");
scanf("%d",&n);
for ( i = 1 ; i <= n ; i++ )
{
for ( j = i ; j < n ; j++ )
printf(" ");
for ( j = 1 ; j <= 2*i - 1 ; j++ )
printf("*");
for ( j = 2*i ; j <= 2*n-1 ; j++ )
printf(" ");
for ( j = 1 ; j <= 2*i - 1 ; j++ )
printf("*");
printf("\n");
}
getch();
}
Output:-

C programming code of patterns
#include<stdio.h>
#include<conio.h>
void main()
{
int n, i, j;
clrscr();
printf("\n Enter the number of rows in pyramid ");
scanf("%d",&n);
for ( i = 1 ; i <= n ; i++ )
{
for ( j = i ; j < n ; j++ )
printf(" ");
for ( j = 1 ; j <= 2*i - 1 ; j++ )
printf("*");
for ( j = 2*i ; j <= 2*n-1 ; j++ )
printf(" ");
for ( j = 1 ; j <= 2*i - 1 ; j++ )
printf("*");
printf("\n");
}
getch();
}
Output:-
