Search C Program | nimishsoft@gmail.com

Number Pattern - 55

1     
2 6    
3 7 10   
4 8 11 13  
5 9 12 14 15 

int main()
{
    int i,j,k=1;
    int m[5][5]={0};
    for(i=0;i<5;i++)
    {
        for(j=i;j<=4;j++)
            m[j][i]=k++;
    }
    for(i=0;i<5;i++)
    {
        for(j=0;j<5;j++)
        {
            if(m[i][j]==0)
                printf(" ");
            else
                printf("%d ",m[i][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



7 comments:

  1. it's really a helpful site for me

    ReplyDelete
  2. int main()
    {
    int count=0;
    int n=5;

    for(int i=1;i<=n;i++) {
    {
    count=i
    for(int j=0;j0)
    count=(count+ n)-j;
    printf("%d ",count);
    else
    printf("%d ",i);
    }
    printf("\n");
    }
    return 0;
    }

    ReplyDelete
  3. C program to print the following pattern : 1 2 6 3 7 10 4 8 11 13 5 9 12 14 15

    #include
    int main()
    { int n,i,j;
    printf("Enter n\n");
    scanf("%d",&n);
    for(i=0;i<=n-1;i++)
    {
    for(j=0;j<=i;j++)
    {
    printf("%d ",(((2*n-1-j)*j)/2)+(i+1));
    }
    printf("\n"); }
    }

    ReplyDelete
  4. program for 15 10 5 0 5 10 15 when we give input as 15 5

    ReplyDelete
  5. caeconAbudd-ri Susan Ortega click
    bapcompmondse

    ReplyDelete