Index-1              Index-2              Home Page

Program to built the pattern



Write a program to built the below pattern.

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


1
12
123
1234
12345
123456
12345
1234
123
12
1

2 comments:

  1. #include

    int main()
    {
    int i, j;

    for(i=1;i<=6;i++){
    for(j=i;j<=6;j++){
    printf("*");
    }
    printf("\n");
    }

    for(i=2;i<=6;i++){
    for(j=1;j<=i;j++)
    {
    printf("*");
    }
    printf("\n");
    }

    printf("\n\n");

    for(i=1;i<=6;i++)
    {
    for(j=1;j<=i;j++)
    {
    printf("%d", j);
    }
    printf("\n");
    }

    for(i=5;i>=1;i--)
    {
    for(j=1;j<=i;j++)
    {
    printf("%d", j);
    }
    printf("\n");
    }

    return 0;
    }


    Get More Codes

    ReplyDelete
  2. Hi Mahfuzur Rahman,Nice c Program for the above pattern..Thanks da..

    -Aparna
    Theosoft

    ReplyDelete