Follow Me

Star patterns exercises in C Programming in C

  • Star pattern 1: \(\begin{array}{c } * \\ *\\  *\\  *\end{array}\)  Write a program that reads a number and displays a star on each line....
  • Star pattern 2: \(\begin{array}{c c c c }  *  &*   & *   &* \\  *  &*   & *   &*  \\  *  &*   & *   &* \\*  &*   & *   &*       \end{array}\)  Write a program that reads a number and displa...
  • Star pattern 3: \(\begin{array}{c c c c }  *  &*   & *   &* \\  *  &    &     &*  \\  *  &    &     &* \\*  &*   & *   &*       \end{array}\)  Write a program that reads a number and disp...
  • Star pattern 4: \(\begin{array}{c c c c c c c } & & & * & * & * & * \\  & & * & * & * & * & \\ & * & * & * & * & & \\ * & * & * & * & & &   \end{array}\)  Write a ...
  • Star pattern 5: \(\begin{array}{c c c c c c c } & & & * & * & * & * \\  & & * &   &  & * & \\ & * &   &   & * & & \\ * & * & * & * & & &   \end{array}\)  Wr...
  • Star pattern 6: \(\begin{array}{c c c c } * & & & \\ * & * & & \\  * & * & * &     \\    * & * & * & * \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 7: \(\begin{array}{c c c c } * & & & \\ * & * & & \\  * &   & * &     \\    * & * & * & * \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 8: \(\begin{array}{c c c c }& & & *\\ & & * & * \\ & * & * & *    \\  * & * & * & * \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 9: \(\begin{array}{c c c c }& & & *\\ & & * & * \\ & * & & *    \\  * & * & * & * \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 10: \(\begin{array}{c c c c }* & * & * & * \\ * & * & * &\\* & * & & \\* & & &  \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 11: \(\begin{array}{c c c c }* & * & * & * \\ * &   & * &\\* & * & & \\* & & &  \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 12: \(\begin{array}{c c c c }* & * & * & * \\  &   *& * & *\\ &  & *& *\\& & &* \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 13: \(\begin{array}{c c c c }* & * & * & * \\  &   *&   & *\\ &  & *& *\\& & &* \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 14: \(\begin{array}{c c c c c}   & & * & & \\   &  * & * &  *& \\  *  &*   & *   &* & *      \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 16: \(\begin{array}{c c c c c}   *&* &*&*&*   \\ &*&* &*& \\ & & * & & \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 17: \(\begin{array}{c c c c c}   *&* &*&*&*   \\   &  * &  &  *& \\ & & * & & \end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 18: \(\begin{array}{cccc}*&&&\\*&*&&\\*&*&*&\\*&*&*&*\\*&*&*&\\*&*&&\\*&&&\end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 19: \(\begin{array}{cccc}*&&&\\*&*&&\\*&&*&\\*&&&*\\*&&*&\\*&*&&\\*&&&\end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 20: \(\begin{array}{cccc}&&&*\\&&*&*\\&*&*&*\\*&*&*&*\\&*&*&*\\&&*&*\\&&&*\end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 21: \(\begin{array}{cccc}&&&*\\&&*&*\\&*&&*\\*&&&*\\&*&&*\\&&*&*\\&&&*\end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 22: \(\begin{array}{ccccc}&&*&&\\&*&*&*&\\*&*&*&*&*\\&*&*&*&\\&&*&&\end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 23: \(\begin{array}{ccccc}&&*&&\\&*&&*&\\*&&&&*\\&*&&*&\\&&*&&\end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 24: \(\begin{array}{ccccc}*&&&&*\\&*&&*&\\&&*&&\\&*&&*&\\*&&&&*\end{array}\)  Write a program that reads a number and displays the above pattern....
  • Star pattern 25: \(\begin{array}{ccccc}&&*&&\\&&*&&\\*&*&*&*&*\\&&*&&\\&&*&&\end{array}\)  Write a program that reads an odd number and displays the above pattern....
  • Star pattern 26: \(\begin{array}{ccccccc}&&*&*&*&&\\&&*&*&*&&\\*&*&*&*&*&*&*\\*&*&*&*&*&*&*\\*&*&*&*&*&*&*\\&&*&*&*&&\\&&*&*&*&&\end{array}\)...
  • Star pattern 27: \(\begin{array}{ccccccccc}&&&&*&&&&\\&&&I&*&I&&&\\&&*&*&*&*&*&&\\&I&*&*&*&*&*&I&\\*&*&*&*&*&*&*&*&*\end{array}\)...
  • Star pattern 15: \(\begin{array}{c c c c c}   & & * & & \\   &  * &  &  *& \\  *  &*   & *   &* & *      \end{array}\)  Write a program that reads an integer x and then prints on the screen a triangle o...

Back to the list of exercises