Search C Program

Star Patterns


    *
   *** 
  *****
 *******
*********
*********
 *******
  *****
   ***   
    *
Code of above pattern


Code of above pattern


**********
****  ****
***    ***
**      **
*        *
**      **
***    ***
****  ****
**********
    *
   *** 
  *****
 *******
*********
 *******
  *****
   ***   
    *
Code of above pattern


Code of above pattern


*
**
***
****
*****
*****
****
***
**
*
Code of above pattern


Code of above pattern


    *
   **
  ***
 ****
*****
*****
 **** 
  *** 
   ** 
    *
Code of above pattern


Code of above pattern


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

Code of above pattern






Related Links:
Number Pattern
http://cbasicprogram.blogspot.in/2012/04/number-patterns.html

Alphabet Pattern
http://cbasicprogram.blogspot.in/2013/03/alphabet-patterns.html

Series Programs
http://cbasicprogram.blogspot.in/2013/01/series-program.html

35 comments:

  1. i want code for the pattern
    0 0
    0 0 0 0
    0 0 0 0 0 0

    ReplyDelete
    Replies
    1. use this http://cbasicprogram.blogspot.in/2012/03/star-pattern-1.html
      and print 00 instead of *

      Delete
    2. for(i=1;i<=height;i++)
      {printf("#");
      for(j=1;j<=i;j++)
      {
      printf("#");
      }
      printf("\n");
      }

      Delete
    3. take a variable for number of rows(i) and for number of columns(j) that is:- int i,j;
      put the loop for 'i' and start with 1(i=1) and till the (i<=3) and then increament of i(i++).

      same as for j variable. starts with 2 and put the condition and then increament j+2;


      uh can use decision making control statement ( if else ) in it.

      Delete
    4. very nice site
      thank you very much

      Delete
  2. Replies
    1. simply add loops of http://cbasicprogram.blogspot.in/2012/03/star-pattern-1.html and http://cbasicprogram.blogspot.in/2012/03/star-pattern-2.html one after other

      Delete
    2. *
      **
      ***
      ****
      ***
      **
      *


      #include

      main()
      {
      int n, c, k;

      printf("Enter number of rows\n");
      scanf("%d",&n);

      for ( c = 1 ; c <= n ; c++)
      {
      for ( k = 1 ; k <= c ; k++ )
      printf("*");

      printf("\n");
      }

      for ( c = n - 2 ; c >= 0 ; c-- )
      {
      for ( k = c ; k >= 0 ; k-- )
      printf("*");

      printf("\n");
      }

      getch();
      }

      Delete
    3. thxx bro. i was searching for this program but was not able to find it. thxx for help

      Delete
  3. how to create a cross mark pattren using a star

    ReplyDelete
    Replies
    1. #include
      #include
      void main()
      {
      int i,j,n;
      clrscr();
      printf("Enter number\n");
      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
      for(j=0;j<n;j++)
      {
      if(i==j || j==(n-i-1))
      {
      printf(" *");
      }
      else
      {
      printf(" ");
      }
      }
      printf("\n");
      }
      getch();
      }

      Delete
  4. how to make rhoumbus frame using star

    ReplyDelete
    Replies
    1. Use two different loops. One, for the top part of the Rhombus, using spaces and stars and the other loop runs in a similar fashion but in with different loop parameters.

      Delete
    2. http://cbasicprogram.blogspot.in/2012/04/star-pattern-8.html

      Delete
  5. 1
    2 6
    3 7 10
    4 8 11 13
    5 9 12 14 15
    logic for this program

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2013/01/number-pattern-55.html

      Delete
  6. Very helpful site thank you so much sir

    ReplyDelete
  7. Can anyone help me to understand the logic of patterns programs..please help..reply asap

    ReplyDelete
  8. help me for basic pattern programming

    ReplyDelete
  9. how to create a both the diagonals of a square

    ReplyDelete
  10. intelligent mind

    ReplyDelete
  11. for(i=1;i<=n;i++)
    {
    diff=n-1;
    p=i;
    for(j=1;j<=i;j++)
    {
    printf("%d",p);
    p=p+diff;
    diff--;
    }
    }

    ReplyDelete
  12. easiest way of pattern coding i have ever seen..thnksaton

    ReplyDelete