Pattern 22 : mirrored triangle star pattern program using for loops in C
Program to print mirrored triangle star pattern on the console:
Write a C program to print the mirrored triangle star pattern. The pattern should look like something below.
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 star pattern Program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#include<stdio.h> int main() {     int i,j,k,n;      printf("Enter Number : ");     scanf("%d",&n);     for(i=n;i>0;i--)     {         for(j=1;j<=(n-i);j++)             printf("  ");    // Two Spaces                 for(j=1;j<=i;j++)         {             printf("* ");         }         printf("\n");     }     return 0; } |
Triangle Program Output :
You may also like:
- Basic star pattern program (The square pattern with stars).
- Triangle star pattern program.
- Triangle star pattern program with Spaces.
- Pyramid star pattern.
- Reverse Pyramid program.
- Diamond Star pattern program.
- star pattern program.
- K-Star pattern program.
- Empty Rhombus program.
- X-Star pattern program
More C programs:
- Program to calculate Maximum of three numbers.
- What are Prime Number and C program to Check given number is Prime or Not
- Check given Number is Prime or not Using Square Root(sqrt) Function.(Efficient way)
- C Program to generate prime numbers between two numbers
- C Program to generate first N prime numbers.
- C program to Calculate percentage of student.
- C Program to check given year is the leap or not.
- C Program to convert Temperature.
- C program to understand type conversation.
- Finding Largest of two numbers using the conditional operator in C.
- C program to calculate the simple Interest,
- C program to understand Size of Operator.
- 200+ C Programs.