Question: C language module c-1 (1.13/1.14) HW Exercise 1.13: In pascal.c, create a 2D array to store and print Pascal's triangle (Each element is the sum

C language

module c-1 (1.13/1.14)

C language module c-1 (1.13/1.14) HW Exercise 1.13: In pascal.c, create a

HW Exercise 1.13: In pascal.c, create a 2D array to store and print Pascal's triangle (Each element is the sum of the two elements immediately above, slightly to the left and to the right). Sample triangle: 1 2 1 1 3 3 1 1 4 641 Ensure that only as much space as needed is used for the array, so that the first row is of size 1, the second of size 2, and so on. You can hard code the first entry in the array, but the rest should be calculated by your program depending on the value of the size variable. Use malloc to create the space, but use array brackets to access the elements. Place the output for size-10 in your response file. Hint: The output above has added white space to show the adjacency relationship. Your program does not need extra spaces before each line, so your program would produce the output below for size-5 1 2 1 1 33 1 1 4 6 4 1 HW Exercise 1.14: In pascal2.c, repeat the exercise except that this time use pointer arithmetic instead of array brackets

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!