Pyramid pattern

 #include <stdio.h>


int main () {

int totalrow, row , space, symbol;

printf("Enter the number of row :  ");

scanf("%d", &totalrow);

for (row = 1 ; row <= totalrow; row++){

    for (space =1 ; space <= (totalrow-row); space++){

        printf(" ");

    }

    for(symbol=1; symbol <= ((row*2)-1); symbol++){

        printf("*");

    } printf("\n");

}


return 0 ;}

Comments

Popular posts from this blog

Factors : using C

Cross shaped pattern

Factorial ! calculation