Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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: image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago