The kite star pattern is a diamond with a short tail hanging from its bottom point. It reuses the diamond star pattern and adds two more rows from the top of a pyramid.
Quick answer: Print the diamond first: a pyramid for rows 1 to n, then rows n − 1 down to 1. Then print rows 2 and 3 of the same pyramid again; they hang under the point and form the tail. Every row uses the same rule, n − i spaces and 2i − 1 stars.
This program is part of the Tricky Patterns collection.
Table of contents8 sections
Kite Star Pattern output
Output (n = 4):
* *** ***** ******* ***** *** * *** *****

How the kite star pattern works
All three parts of the kite print rows from the same pyramid; they only choose different rows. The upper half counts up to the widest row, the lower half counts back down to a single star, and the tail picks rows 2 and 3 so that it widens slightly under the point. Because each row is built with the same spaces and stars, everything lines up on the centre column automatically.
- Run the outer loop for
ifrom1ton, one row per pass (upper half of the kite). - Print
n − ispaces. - Print
2 × i − 1stars. - Move to the next line.
- Run the outer loop for
ifromn − 1down to1, one row per pass (lower half). - Print
n − ispaces. - Print
2 × i − 1stars. - Move to the next line.
- Run the outer loop for
ifrom2to3, one row per pass (the tail). - Print
n − ispaces. - Print
2 × i − 1stars. - Move to the next line.
Key takeaways
- The kite is a diamond plus a short pyramid tail.
- All three parts print rows of the same pyramid, so they share one centre line.
- Choosing which rows to print, not new formulas, is what changes the shape.
- Start the tail at row 2 so it does not repeat the single star of the point.
Kite Star Pattern in C
#include <stdio.h>
int main(void) {
int n = 4;
// upper half of the kite
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n - i; j++)
printf(" ");
for (int j = 1; j <= 2 * i - 1; j++)
printf("*");
printf("\n");
}
// lower half
for (int i = n - 1; i >= 1; i--) {
for (int j = 1; j <= n - i; j++)
printf(" ");
for (int j = 1; j <= 2 * i - 1; j++)
printf("*");
printf("\n");
}
// the tail
for (int i = 2; i <= 3; i++) {
for (int j = 1; j <= n - i; j++)
printf(" ");
for (int j = 1; j <= 2 * i - 1; j++)
printf("*");
printf("\n");
}
return 0;
}Kite Star Pattern in C++
#include <iostream>
using namespace std;
int main() {
int n = 4;
// upper half of the kite
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n - i; j++)
cout << " ";
for (int j = 1; j <= 2 * i - 1; j++)
cout << "*";
cout << endl;
}
// lower half
for (int i = n - 1; i >= 1; i--) {
for (int j = 1; j <= n - i; j++)
cout << " ";
for (int j = 1; j <= 2 * i - 1; j++)
cout << "*";
cout << endl;
}
// the tail
for (int i = 2; i <= 3; i++) {
for (int j = 1; j <= n - i; j++)
cout << " ";
for (int j = 1; j <= 2 * i - 1; j++)
cout << "*";
cout << endl;
}
return 0;
}Kite Star Pattern in Java
public class KiteStar {
public static void main(String[] args) {
int n = 4;
// upper half of the kite
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n - i; j++)
System.out.print(" ");
for (int j = 1; j <= 2 * i - 1; j++)
System.out.print("*");
System.out.println();
}
// lower half
for (int i = n - 1; i >= 1; i--) {
for (int j = 1; j <= n - i; j++)
System.out.print(" ");
for (int j = 1; j <= 2 * i - 1; j++)
System.out.print("*");
System.out.println();
}
// the tail
for (int i = 2; i <= 3; i++) {
for (int j = 1; j <= n - i; j++)
System.out.print(" ");
for (int j = 1; j <= 2 * i - 1; j++)
System.out.print("*");
System.out.println();
}
}
}Kite Star Pattern in Python
n = 4
# upper half of the kite
for i in range(1, n + 1):
for j in range(1, n - i + 1):
print(" ", end="")
for j in range(1, 2 * i):
print("*", end="")
print()
# lower half
for i in range(n - 1, 0, -1):
for j in range(1, n - i + 1):
print(" ", end="")
for j in range(1, 2 * i):
print("*", end="")
print()
# the tail
for i in range(2, 4):
for j in range(1, n - i + 1):
print(" ", end="")
for j in range(1, 2 * i):
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
How do I make the tail longer?
Print more rows in the third part, for example rows 2 to 4. For a narrow tail print a single star on each row instead, with n − 1 spaces in front.
Can I print a hollow kite?
Yes. Print a star only at the first and last position of each row, as in the hollow diamond star pattern, and keep the tail solid or hollow.
How do I let the user choose the size?
Read n from the keyboard instead of fixing it in the code: scanf("%d", &n); in C, cin >> n; in C++, new Scanner(System.in).nextInt() in Java and int(input()) in Python.











