Search C Program | nimishsoft@gmail.com

Number Pattern - 12

11111
2222
333
44
5

#include <stdio.h>

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

    return 0;
}

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

7 comments:

  1. void generate6(int n)
    {
    static int a;
    a=n;
    for(int i1=1;i1<=n;i1++)
    {
    cout<<endl;
    for(int j1=1;j1<=a;j1++)
    {
    cout<<i1;
    }
    --a;
    }
    }

    ReplyDelete
  2. #include
    int main()
    {
    int i,j;
    for(i=1;i<=5;i++){
    for(j=i;j<=5;j++)
    {
    printf("%d",i);
    }
    printf("\n");
    }
    return 0;
    }

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. There should be j>=1 instead of i

    ReplyDelete
  5. can u explain how to do same problem using user defined function please

    ReplyDelete
  6. 5
    4 3
    3 2 1
    3 4
    5


    How to print this pattern in c language

    ReplyDelete
  7. 11111 11111
    2222 2222
    333 333
    44 44
    5 5

    ReplyDelete