Output an equilateral triangle figure

the following code outputs a left-aligned two-dimensional pyramid graph. How to center each line of the final graph?

{   int i,j;
for(i=0;i<4;iPP){
    for(j=0; j<i+1; jPP)  printf("*");    //   
    printf("\n");
}
C
Dec.03,2021
Menu