recursive function, C/C++ Programming

Binomial coefficients are the numeric factors of the products in a power of a binomial such as (x + y)n. For example, (x + y)2 = x2 + 2 x y + y2 has the coefficients 1 2 1. Binomial coefficients can be calculated using Pascal''s triangle:
1 n = 0
1 1
1 2 1
1 3 3 1
1 4 6 4 1 n = 4
Each new level of the triangle has 1''s on the ends; the interior numbers are the sums of the two numbers above them. Write a program that includes a recursive function to produce a list of binomial coefficients for the power n using the Pascal''s triangle technique. For example,
Input = 2 Output = 1 2 1
Input = 4 Output = 1 4 6 4 1
Posted Date: 12/1/2012 11:53:22 AM | Location : Pakistan







Related Discussions:- recursive function, Assignment Help, Ask Question on recursive function, Get Answer, Expert's Help, recursive function Discussions

Write discussion on recursive function
Your posts are moderated
Related Questions
Program to Open a file in C++: int main() {                  char ch;                  ifstream f1 ("OLDFILE.TXT");                  ofstream f2 ("NEWFILE.TXT");

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Differences between a pointer and a reference 1.  A reference must always point to some object where as this restriction is not imposed on a pointer. e.g. int *pi = 0;

A: Provided that function parameter is "const reference", compiler create temporary variable in following two ways. a) The actual argument is the correct type, however it isn't

What is inheritance? Class, the vehicle, which is used to execute object-oriented concepts in C++, has given a new dimension to this idea of reusability. Many vendors now offer

C Program to Check  EVEN & ODD NO   main() {           int n, a;           clrscr();           printf("ENTER ANY NUMBER: ");           scanf("%d", &n);


Define Keywords in C++ K e y w o r d s: K e y w o rd s a r e t h e w o rd s a l r e a d y u s e d b y C + + i n i t s c