Search C Program

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



1 comment: