06 September 2011

10 challenging star pattern program in c

Computer languages are not as easy as human languages, they need you to become a computer yourself, think like a computer and write an algorithm. Computer programs are fun if you take them up as a challenge, as unsolved puzzles. There is lot of fun in taking up the challenge, understanding the problem, writing an algorithm, writing a program and most importantly running the program and obtaining required output.
Here are few challenging C program questions for you. Let’s see how many of them you would be able to write without seeing the program solution given below. These questions are to print patterns using asterisk(star) character. Comment below if you have tougher pattern questions.


  1. Write a C program to print the following pattern:
    *
          *  *
       *  *  *
    *  *  *  *
    
  2. Write a C program to print the following pattern:
    *                   *
    * * *           * * *
    * * * * *   * * * * *
    * * * * * * * * * * *
    
  3. Write a C program to print the following pattern:
    *                         *
       *                   *
    *     *             *     *
       *     *       *     *
    *     *      *      *     *
       *     *       *     *
    *     *             *     *
       *                   *
    *                         *
    
  4. Write a C program to print the following pattern:
    *   *   *   *   *
      *   *   *   *
        *   *   *
          *   *
            *
          *   *
        *   *   *
      *   *   *   *
    *   *   *   *   *
    
  5. Write a C program to print the following pattern:
    *
            * * *
          * * * * *
        * * * * * * *
      * * * * * * * * *
        * * * * * * *
          * * * * *
            * * *
              *
            * * *
          * * * * *
    
  6. Write a C program to print the following pattern:
    *
           * *
             * * *
               * * * *
             * * *
           * *
         *
    
  7. Write a C program to print the following pattern:
    * * * * * * * * *
    * * * *   * * * *
    * * *       * * *
    * *           * *
    *               *
    * *           * *
    * * *       * * *
    * * * *   * * * *
    * * * * * * * * *
    
  8. Write a C program to print the following pattern:
    * * * * * * * * * * * * * * * * *
      * * * * * * *   * * * * * * *
        * * * * *       * * * * *
          * * *           * * *
            * * * * * * * * *
              * * * * * * *
                * * * * *
                  * * *
                    *
    
  9. Write a C program to print the following pattern:
    *
        * * *
      * * * * *
    * * * * * * *
    *           *
    * *       * *
    * * *   * * *
    * * * * * * *
    * * *   * * *
    * *       * *
    *           *
    * * * * * * *
      * * * * *
        * * *
          *
    
  10. Write a C program to print the following pattern:
    * * * * * * * * * * * * * * * * * * * * * * * * *
      *           *   *           *   *           *
        *       *       *       *       *       *
          *   *           *   *           *   *
            *               *               *
          *   *           *   *           *   *
        *       *       *       *       *       *
      *           *   *           *   *           *
    * * * * * * * * * * * * * * * * * * * * * * * * *
    

1 comments:

Kathi said...

whats the answer

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More