Search C Program | nimishsoft@gmail.com

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

9 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
  5. #include
    int main()
    {
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
    for(int j=n-i+1;j>=1;j--)
    {
    printf("%d ",j);
    }
    printf("\n");
    }
    return 0;
    }

    ReplyDelete
  6. In C++ language;

    #include
    using namespace std;

    int main(){
    int n;
    cin >> n;
    int i = 1;
    while(i<=n){
    int j = n-i+1;
    while(j>0){
    cout << j;
    j--;
    }
    cout << endl;
    i++;
    }
    }

    ReplyDelete
  7. Ethanks great site for coding

    ReplyDelete