Pattern 3 :C Program to print Star pattern | Triangle star pattern program.

Spread the love
Pattern 3 : Write a C Program to print below pattern ( Triangle Star pattern with spaces).

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

Program :

  1. #include<stdio.h>
  2. int main()
  3. {
  4.         int i,j,n;
  5.         printf(“Enter how many rows you want: “);
  6.         scanf(“%d”,&n);
  7.         for(i=1;i<=n;i++)
  8.         {
  9.                 for(j=1;j<=(ni);j++)
  10.                         printf(”  “);   // two spaces
  11.                 for(j=1;j<=i;j++)
  12.                         printf(” *”);
  13.                 printf(n);
  14.         }
  15.         return 0;
  16. }

Output :

Output of star pattern program

Similar Star pattern programs:

Also See:

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply