Search C Program

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

3 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