Search C Program

Loading...

Number Pattern - 7

54321
4321
321
21
1

#include <stdio.h>

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

5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. for(int i=1;i<=5;i++)
    {
    for(int j=5;j>=i;j--)

    System.out.print(j+1-i);
    System.out.println();
    }

    ReplyDelete
  3. tell me y u use "for(i=5;i>=1;i--) " y dont use for(i=1;i<=5;i++) ??????

    ReplyDelete
    Replies
    1. Does it make any difference? You can write it in many ways. This way stroked first to me

      Delete
  4. #include

    int main()
    {
    int r,i,j;

    printf("Enter the number of rows : ");
    scanf("%d",&r);

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

    return 0;
    }

    ReplyDelete