How do you write a program to create pascal triangle using only one 'for' loop using 'C'?

int factorial (int n)

{

if (n==0) return 1;

else return (n*factorial(n-1));

}

int combo (int n, int r)

{

return (factorial (n))/(factorial (r) * (factorial (n-r)));

}

int width(int n, int i, int j)

{

return(j==0?(((n+1)*2)-((i==0)?i:(i-j))):(j<=3)?j+1:j-1);

}

void print (int n)

{

int i, j;

for (i = 0; i<=n; ++i)

{

for (j = 0; j<=i; ++j)

{

printf ("%*d", width(n,i,j) ,combo (i, j));

if (i==j)

{

printf("\n");

}

}

}

}

int main ()

{

int row,col;

int maxrow;

printf("\nPlease enter the num of rows for pascal triangle : ");

scanf("%d",&maxrow);

printf("The Pascal Triangle for %d rows is :\n",maxrow);

print(maxrow);

printf("To get the value at any row, col please enter \nRow:");

scanf("%d",&row);

printf("Col:");

scanf("%d",&col);

printf("\nThe value at row %d & col %d is : %d\n",row,col,combo(row,col));

}