Page 1 of 1

in c programming Write a program to compute the value of a given position in Pascal's Triangle (Recursion would work wel

Posted: Sun May 15, 2022 8:23 am
by answerhappygod
in c programming Write a program to compute the value of a
given position in Pascal's Triangle
(Recursion would work well here).
The way to compute any given position's value is to add up the
numbers to the
position's right and left in the preceding row. For instance, to
compute the
middle number in the third row, you add 1 and 1; the sides of the
triangle are
always 1 because you only add the number to the upper left or the
upper right
(there being no second number on the other side).
The program should prompt the user to input a row and a position in
the row. The program should
ensure that the input is valid before computing a value for the
position.
You must use main() and at least one other function.