Star patterns are a series of *
or any other character used to create some pattern or any geometrical shape such as – square, triangle(Pyramid), rhombus, heart etc. These patterns are often prescribed by many programming books and are best for practicing flow control statement.
Many programmers around world extremely recommended pattern problems, to enhance logical thinking capabilities. As a novice programmer you must practice these patterns to get a good hands on logical thinking and program flow control.
In this exercise I have compiled a list of Star patterns to practice for beginners and intermediate programmers. I have tried my best to explain the logic of each pattern individually.
If you got stuck with some pattern or have some query or suggestion, always feel free to write it down below in the comments section. I always love to hear from you all.
Required knowledge
Basic C programming, Operators, If else, For loop, Nested loop
List of star pattern programming exercises
-
***** ***** ***** ***** *****
Square Star Pattern -
***** * * * * * * *****
Hollow Square Star Pattern -
***** ** ** * * * ** ** *****
Hollow Square Star Pattern with Diagonal -
***** ***** ***** ***** *****
Rhombus Star Pattern -
***** * * * * * * *****
Hollow Rhombus Star Pattern -
***** ***** ***** ***** *****
Mirrored Rhombus Star Pattern -
***** * * * * * * *****
Hollow Mirrored Rhombus Star Pattern -
* ** *** **** *****
Right Triangle Star Pattern -
* ** * * * * *****
Hollow Right Triangle Star Pattern -
* ** *** **** *****
Mirrored Right Triangle Star Pattern -
* ** * * * * *****
Hollow Mirrored Right Triangle Star Pattern -
***** **** *** ** *
Inverted Right Triangle Star Pattern -
***** * * * * ** *
Hollow Inverted Right Triangle Star Pattern -
***** **** *** ** *
Inverted Mirrored Right Triangle Star Pattern -
***** * * * * ** *
Hollow Inverted Mirrored Right Triangle Star Pattern -
* *** ***** ******* *********
Pyramid Star Pattern -
* * * * * * * *********
Hollow Pyramid Star Pattern -
********* ******* ***** *** *
Inverted Pyramid Star Pattern -
********* * * * * * * *
Hollow Inverted Pyramid Star Pattern -
* ** *** **** ***** **** *** ** *
Half Diamond Star Pattern -
* ** *** **** ***** **** *** ** *
Mirrored Half Diamond Star Pattern -
* *** ***** ******* ********* ******* ***** *** *
Diamond Star Pattern -
********** **** **** *** *** ** ** * * * * ** ** *** *** **** **** **********
Hollow Diamond Star Pattern -
***** **** *** ** * ** *** **** *****
Right Arrow Star Pattern -
***** **** *** ** * ** *** **** *****
Left Arrow Star Pattern -
+ + + + +++++++++ + + + +
Plus Star Pattern -
* * * * * * * * * * * * * * * * *
X Star Pattern -
*** * * * * * * *** * * * * * * ***
Eight Star Pattern -
***** ***** ******* ******* ********* ********* ******************* ***************** *************** ************* *********** ********* ******* ***** *** *
Heart Star Pattern -
***** ***** ******* ******* ********* ********* *****Codeforwin**** ***************** *************** ************* *********** ********* ******* ***** *** *
Heart Star Pattern with Name