C Programming
Computer Programming

Program in C to display the complete triangular star pattern



Write a Program in c to display the following Pattern

         *
      * * *
   * * * * *
* * * * * * *

\* C Program to display the triangular star pattern *\

# include < stdio.h >
int   main( )
{

int   i, j, r ;
printf(" Enter the Number of row : ") ;
scanf("%d ", & r) ;
printf("\n Pattern are : \n\n") ;
for (  i = 1 ; i < = r ; i++ )
{

for (  j = i ; j < = r ; j++ )
printf("    ") ;

for (  j = 1 ; j < = 2 * i - 1 ; j++ )
{

printf("   *") ;

}
printf(" \n ") ;

}
return ( 0 );

}

Output of Program :

Output of Program in C to display the triangular star pattern