diff --git a/misc/catalan.c b/misc/catalan.c new file mode 100644 index 00000000..6e8dde34 --- /dev/null +++ b/misc/catalan.c @@ -0,0 +1,28 @@ +/* +code for computing nth catalan number +*/ +#include +long int factorial(int x) //long int for more than 10 factorial +{ + int i; + long int fac; //fac stores x factorial + fac=x; + for(i=1;i