Question: (Basic C-programming) Hello, the program below creates a pascal's triangle, where the lo ng fun(int y) calculates the factorial whenever the function is called. x

(Basic C-programming) Hello, the program below creates a pascal's triangle, where the long fun(int y) calculates the factorial whenever the function is called. x and z are for loop control and y has been defined to store the number of rows entered by the user.

My question is, what should the code be so I can change the spacing between each number on the triangle? I want the spacing between each number on the pascal's triangle to be 6 characters long, but I still want the number displayed in the last column always to be at the start of the line.

Example: (Basic C-programming) Hello, the program below creates a pascal's triangle, where the

MY CODE:

#include long fun(int y) { int z; long result = 1;

for( z = 1 ; z

return ( result ); } int main() { int x, y, z; printf("Input the number of rows in Pascal's triangle: "); scanf("%d",&y); for ( x = 0 ; x

printf(" "); } return 0; }

Please help ASAP. Thanks!!!

Enter the number ofrows: 6 2 1 1 1 4 6 4 5 10 10 5 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!