Search C Program | nimishsoft@gmail.com

Number Pattern - 11

55555
4444
333
22
1

#include <stdio.h>

int main()
{
    int i, j;
    for(i=5;i>=1;i--)
    {
        for(j=1;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

6 comments:

  1. can we also write the 2nd for loop statement as for(j=1;j>=i;j--) ?

    ReplyDelete
  2. You can also try this for the above output

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

    ReplyDelete
  3. #include

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

    return 0;
    }
    its giving the same output

    ReplyDelete
  4. ****1
    ***22
    **333
    *4444
    55555

    answer fro this pattren please

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

    ReplyDelete