answersLogoWhite

0

#include <iostream.h>

double fact(double n)

{

return (n > 1) ? n * fact(n - 1) : 1;

}

double ncr(int n, int r)

{

return fact(n) / (fact(r) * fact(n - r));

}

int main()

{

for (int i = 0; i < 15; i++)

{

for (int j = 0; j <= i; j++)

cout <<ncr(i, j) << ' '; cout << endl;

}

return 0;

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Do I need a C plus plus program to print PASCAL's triangle?

No.


Do a program with turbo pascal to print the alphabet backward?

Turbo Pascal is a style of computer programming. This type of writing language can be used to create a program that prints the alphabet backwards.


Write a pascal program that compute an area of a triangle?

{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.


Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write a program in qbasic to make a hut using print statemant?

a triangle then a square :)


How many times will the program will print Language?

Without seeing the program, I can only say: 'zero or more times'


How do you print a triangle of stars?

write a c++ programe to print a triangle without (for)


What is program that will print all the multiples of 4 till 120?

Depending on language, here's an example: for i=4 to 120 step 4 print i next


Write a program in 'C' language to accept 6 strings as input and print them in lexicographic?

(ab)*b


How do you write a program to print numbers from star one and next line star two in php?

Try the triangle program on a search engine. Replace numbers with stars and that should do the trick


Write a C plus plus function that print a triangle of stars?

Write a function that print a triangle of stars.


Example of procedural programming language and object oriented programming language?

example of procedural programming are those programming language that have structure e.g basic,fortran,c++,c and pascal e.t.c