Star patterns in C programming

Star patterns are a series of '*' or any other character that are used to create some patterns 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 loops in programming and to enhance logical thinking capability. Before printing any star pattern you must have knowledge of loops and basic of pattern printing (Logic to print star patterns and shape).

Below is a list of easy and hard star patterns in C programming with explanation. Practice as much as you can to increase your logical thinking.

List of various star pattern series and solution in C programming

*****
*****
*****
*****
*****

1. Square

*****
*   *
*   *
*   *
*****

2. Hollow Square

    *****
   *****
  *****
 *****
*****

3. Rhombus

    *****
   *   *
  *   *
 *   *
*****

4. Hollow Rhombus

*****
 *****
  *****
   *****
    *****

5. Mirrored Rhombus

*****
 *   *
  *   *
   *   *
    *****

6. Hollow mirrored Rhombus

*
**
***
****
*****

7. Right triangle

*
**
* *
*  *
*****

8. Hollow right triangle

    *
   **
  ***
 ****
*****

9. Mirrored right triangle

    *
   **
  * *
 *  *
*****

10. Hollow mirrored right triangle

*****
****
***
**
*

11. Inverted right triangle

*****
*  *
* *
**
*

12. Hollow inverted right triangle

*****
 ****
  ***
   **
    *

13. Inverted mirrored right triangle

*****
 *  *
  * *
   **
    *

14. Hollow inverted mirrored right triangle

    *
   ***
  *****
 *******
*********

15. Pyramid (Equilateral triangle)

    *
   * *
  *   *
 *     *
*********

16. Hollow Pyramid

*********
 *******
  *****
   ***
    *

17. Inverted Pyramid

*********
 *     *
  *   *
   * *
    *

18. Hollow inverted pyramid

*
**
***
****
*****
****
***
**
*

19. Half diamond

    *
   **
  ***
 ****
*****
 ****
  ***
   **
    *

20. Mirrored half diamond

    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *

21. Diamond

**********
****  ****
***    ***
**      **
*        *
*        *
**      **
***    ***
****  ****
**********

22. Hollow diamond

*****
  ****
    ***
      **
        *
      **
    ***
  ****
*****

23. Right Arrow

    *****
   ****
  ***
 **
*
 **
  ***
   ****
    *****

24. Left arrow

    +
    +
    +
    +
+++++++++
    +
    +
    +
    +

25. Plus Star pattern

*       *
 *     *
  *   *
   * *
    *
   * *
  *   *
 *     *
*       *

26. X Star pattern

 ***
*   *
*   *
*   *
 ***
*   *
*   *
*   *
 ***

27. Eight (8) Star pattern

  *****     *****
 *******   *******
********* *********
*******************
 *****************
  ***************
   *************
    ***********
     *********
      *******
       *****
        ***
         *

28. Heart Star pattern 1

  *****     *****
 *******   *******
********* *********
*****Codeforwin****
 *****************
  ***************
   *************
    ***********
     *********
      *******
       *****
        ***
         *

29. Heart Star pattern 2

Write your doubts or suggestion. I will try my best to help. You must escape source code before commenting. To format your source code paste your source code inside
<pre><code> ----Your Source Code---- </code></pre>