C++ Program to Print Inverted Mirrored Right Triangle Star Pattern

Write a C++ program to print the inverted mirrored right angled triangle star pattern using for loop. 

#include<iostream>
using namespace std;

int main()
{
	int i, j, k, rows;
     
    cout << "Enter Inverted Mirrored Right Triangle Star Rows = ";
    cin >> rows;

    cout << "Inverted Mirrored Right Angled Triangle Star Pattern\n"; 

    for(i = rows; i > 0; i--)
    {
    	for(j = rows - i; j > 0; j--)
		{
            cout << " ";
        }
        for(k = 0; k < i; k++)
		{
            cout << "*";
        }
        cout << "\n";
    }		
 	return 0;
}
CPP Program to Print Inverted Mirrored Right Triangle Star Pattern

This C++ example example prints a given character’s mirrored inverted right angled triangle using a while loop.

#include<iostream>
using namespace std;

int main()
{
	int i, j, k, rows;
    char ch;
     
    cout << "Enter Inverted Mirrored Right Triangle Star Rows = ";
    cin >> rows;

    cout << "Enter Symbol for Inverted Mirrored Right Triangle = ";
    cin >> ch;

    cout << "Inverted Mirrored Right Angled Triangle Star Pattern\n"; 
    i = rows;
    while( i > 0)
    {
        j = rows - i;
    	while( j > 0)
		{
            cout << " ";
            j--;
        }
        k = 0;
        while( k < i)
		{
            cout << ch;
            k++;
        }
        cout << "\n";
        i--;
    }		
 	return 0;
}
Enter Inverted Mirrored Right Triangle Star Rows = 15
Enter Symbol for Inverted Mirrored Right Triangle = $
Inverted Mirrored Right Angled Triangle Star Pattern
$$$$$$$$$$$$$$$
 $$$$$$$$$$$$$$
  $$$$$$$$$$$$$
   $$$$$$$$$$$$
    $$$$$$$$$$$
     $$$$$$$$$$
      $$$$$$$$$
       $$$$$$$$
        $$$$$$$
         $$$$$$
          $$$$$
           $$$$
            $$$
             $$
              $

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.