Search C Program

Number Pattern - 2

5
45
345
2345
12345


#include <stdio.h>

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

1 comment:

  1. #include
    int main(){
    int i,j,flag=4;
    int array[]={1,2,3,4,5};
    for(i=1;i<=5;i++){
    for(j=1;j<=i;j++){
    printf("%d ",array[flag] );
    if(flag<4){
    flag++;
    }
    }
    flag=flag-i;
    printf("\n");
    }
    }

    ReplyDelete