Pattern 22 : mirrored triangle star pattern program using for loops in C

Spread the love

Write a C Program to print below pattern on the console:

Desired Pattern:

Enter Number: 7
* * * * * * * 
  * * * * * * 
    * * * * * 
      * * * * 
        * * * 
          * * 
            * 
Few browsers are not showing pattern properly, Here is the pattern in the Image format.

Note : This post is part of my series on Star Pattern programs in C language, Check out all program HERE.

Mirrored triangle pattern program:

  1. /* Star pattern program in C using for loops 
  2.    Author : Venkatesh Macha
  3.    website : www.SillyCodes.com
  4. */
  5.  
  6. #include<stdio.h>
  7. int main()
  8. {
  9.    int i,j,k,n;
  10.    printf(“Enter Number : “);
  11.    scanf(“%d”,&n);
  12.  
  13.    for(i=n;i>0;i)
  14.    {
  15.       for(j=1;j<=(ni);j++)
  16.          printf(”  “);  
  17.  
  18.       for(j=1;j<=i;j++)
  19.       {
  20.  
  21.             printf(“* “);
  22.       }
  23.       printf(n);
  24.    }
  25.    return 0;
  26. }

Output :

You may also like:

More C programs:

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