Question: Solve this recursive function problem using C++ 2. (Recursive Function) (30 points) Display the Pascal's Triangle without using loop. Write a recursive function named pascalTriangle

Solve this recursive function problem using C++

Solve this recursive function problem using C++ 2. (Recursive Function) (30 points)

2. (Recursive Function) (30 points) Display the Pascal's Triangle without using loop. Write a recursive function named pascalTriangle to solve the problem. Write a main function to test it. For example, given 6, your program displays the first 6 rows of the Pascal's Triangle. 1 2 1 1 2 32 1 1 2 34 3 2 1 1 2 3454321 1 2 3 45654 3 2 1 10 extra credit points will be added if your program can display the pascal triangle with proper indentations as follows. 1 2 1 1 2 32 1 1 2 343 2 1 1 234 5 432 1 1 234 5 654321 (Hint: You may need to write another recursive functions to display a single row in the Pascal Triangle. For example, a function void printRow (int m, int n) with two parameters. When called with two arguments, e.g. 2, 5, the function printRow (2,5) displays a sequence 2 3 45432 Your function pascalTriangle can take multiple parameters if need.)

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!