Here it comes Code: void main() { int row,col,sp=4,res; for(col=1;col<=5;col++) { res=sp; for(;sp>0;sp--) printf(" "); res--; sp=res; for(row=1;row<=col;row++) printf("%d ",col); for(row=col-1;row>0;row--) printf("%d ",col); printf("\n"); } }