Search C Program

Number Pattern - 6

12345
2345
345
45
5

#include <stdio.h>

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

8 comments:

  1. Java code :
    int va = 1;
    for(int i=5;i>=1;i--){
    for(int j=1;j<=i;j++){
    System.out.print(j+va-1);
    }
    System.out.println();
    va++;
    }

    ReplyDelete
  2. int i,j,n,k=1;
    scanf("%d",&n);
    for(i=n;i>=1;i--)
    {
    for(j=1;j<=i;j++)
    {
    if(j>n)
    break;
    printf("%d",j);
    }
    printf("\n");
    k++;
    n--;
    }

    ReplyDelete
  3. #include
    #include
    main()
    {
    int i,j;
    for(i=1;i<=5;i++)
    {
    for(j=i;j<=5;j++){

    printf("%d",j);

    }

    printf("\n");


    }
    getch();
    }

    ReplyDelete
  4. #include

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

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

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

    return 0;
    }

    ReplyDelete
  5. #include

    int main(void) {
    // your code goes here
    int i,j,n,k;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
    k = i;
    for(j=n;j>=i;j--)
    {
    printf("%d",k);
    k++;
    }
    printf("\n");
    }
    return 0;
    }

    ReplyDelete