The mirrored parallelogram star pattern prints the same row of 2n stars on every row and moves each row one space to the right, so the block leans the other way from the parallelogram star pattern.
Quick answer: Each row prints i − 1 spaces followed by 2n stars. The star count never changes; the growing indent alone creates the slant, because every row starts one column further right than the row above. For n = 4 that is four rows of eight stars, and the last row starts after three spaces.
This program is part of the Star Patterns collection.
Table of contents8 sections
Mirrored Parallelogram Star Pattern output
Output (4 rows, 8 stars per row):
******** ******** ******** ********

How the mirrored parallelogram star pattern works
This is one of the simplest shapes to code: two loops per row, one for the indent and one for the stars. What makes it a parallelogram rather than a rectangle is that the indent changes by exactly one each row, so both the left and right edges form straight diagonal lines.
- Run the outer loop for
ifrom1ton, one row per pass. - Print
i − 1spaces. - Print
2 × nstars. - Move to the next line.
Key takeaways
- The width stays at
2nstars on every row. - The indent
i − 1grows by one per row, which tilts the block to the right. - Use
n − ispaces instead to tilt it to the left. - Making the width
ninstead of2ngives the mirrored rhombus.
Mirrored Parallelogram Star Pattern in C
#include <stdio.h>
int main(void) {
int n = 4;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i - 1; j++)
printf(" ");
for (int j = 1; j <= 2 * n; j++)
printf("*");
printf("\n");
}
return 0;
}Mirrored Parallelogram Star Pattern in C++
#include <iostream>
using namespace std;
int main() {
int n = 4;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i - 1; j++)
cout << " ";
for (int j = 1; j <= 2 * n; j++)
cout << "*";
cout << endl;
}
return 0;
}Mirrored Parallelogram Star Pattern in Java
public class MirroredParallelogramStar {
public static void main(String[] args) {
int n = 4;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i - 1; j++)
System.out.print(" ");
for (int j = 1; j <= 2 * n; j++)
System.out.print("*");
System.out.println();
}
}
}Mirrored Parallelogram Star Pattern in Python
n = 4
for i in range(1, n + 1):
for j in range(1, i):
print(" ", end="")
for j in range(1, 2 * n + 1):
print("*", end="")
print()Time and space complexity
The program prints one character for each position in the pattern, so for n rows it runs in O(n²) time. It only needs a few loop variables, so the extra memory is O(1).
Frequently asked questions
What is the difference from the mirrored rhombus?
Only the width: a rhombus prints n stars per row, a parallelogram usually 2n. The indent rule is the same.
How do I make a hollow version?
Print stars only on the first and last rows and at the two ends of each row. See the mirrored hollow parallelogram.
Why do both edges slant?
Every row has the same number of stars, so when the start moves one column right, the end moves one column right as well. Both edges therefore follow the same diagonal and stay parallel.
Can the width be any number?
Yes. Replace 2n with any width you like; the slant still comes from the indent.











