Write a Program to print as follows:

Newbie Member
14Mar2006,10:43   #1
meghna's Avatar
Write a Program to print as follows:
*
* # *
* # $ # *
* # $ + $ # *
* # $ # *
* # *
*
Team Leader
14Mar2006,12:19   #2
coderzone's Avatar
Simple. Here it is

Code: C
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 ",row);
    for(row=col-1;row>0;row--)
        printf("%d ",row);
    printf("\n");
}
It will print as 1,2,... and you can initialize the array elements to have your own characters.