Search C Program | nimishsoft@gmail.com

Number Pattern - 53

1
232
34543
4567654
567898765

int main()
{
    int i,j,k;
    for(i=1;i<=5;i++)
    {
        j=i;
        for(k=1;k<=i;k++)
        {
            printf("%d",j++);
        }
        j-=2;
        for(k=j;k>=i;k--)
        {
            printf("%d",j--);
        }        
        printf("\n");
    }
    return 0;
}


Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C


8 comments:

  1. how to achieve this pattern
    1
    2 3 2
    3 4 5 4 3
    4 5 6 7 6 5 4
    5 6 7 8 9 8 7 6 5
    6 7 8 9 0 1 0 9 8 7 6
    7 8 9 0 1 2 3 2 1 0 9 8 7

    ReplyDelete
    Replies
    1. i can't understand can you please teach me by a video

      Delete
  2. In the above code consider j-=1,then it's correct

    ReplyDelete
  3. 1 1 1 1 1
    1 2 2 2 1
    1 2 3 2 1
    1 2 2 2 1
    1 1 1 1 1
    can any one solve this

    ReplyDelete
  4. 543212345
    4321234
    32123
    212
    11

    ReplyDelete
    Replies
    1. #include
      int main()
      {
      int i, j, n, k ,s=0;
      printf("no:");

      scanf_s("%d", &n);
      for (k = n; k >= 1; k--)
      {
      for (j = 1; j <= s; j++)
      {
      printf(" ");
      }
      for (i = k; i >= 1; i--)
      {

      printf("%d", i);

      }
      for (i = 2; i < k; i++)
      {
      printf("%d", i);

      }
      printf("%d",k);

      printf("\n");
      s++;
      }

      return 0;
      }

      Delete