answersLogoWhite

0

#include<stdio.h>

int fact(int);

void main()

{

int n,r,f;

printf("enter value for n & r\n");

scanf("%d%d",&n,&r);

if(n<r)

printf("invalid input");

else

f=fact(n)/(fact(n-r)*fact(r));

printf("binomial coefficient=%d",f);

}

int fact(int x)

{

if(x>1)

return x*fact(x-1);

else

return 1;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Why recursive solution is better for tree traversal?

Because a tree is a recursive data-structure. It's easier to write (and easier to understand) a recursive program for handling it.


Jntu 2-2 oops through java answers?

write a java program to find factorial using recursive and non recursive


How do you write a binomial distribution table in C program?

Class&amp;genus


Write a c program to find GCD of two given integers by using both recursive n non recursive functions?

i love u darling


How do you write a binomial c program?

#include&lt;stdio.h&gt; int fact(int); void main() { int n,r,f; printf("enter value for n &amp; r\n"); scanf("%d%d",&amp;n,&amp;r); if(n&lt;r) printf("invalid input"); else f=fact(n)/(fact(n-r)*fact(r)); printf("binomial coefficient=%d",f); } int fact(int x) { if(x&gt;1) return x*fact(x-1); else return 1; }


How do you write scientific classification?

Binomial nomenclature ( the generic and then the specific name)


To correctly write the binomial nomenclature for a particular animal?

A binomial nomenclature is the two name system of naming living things used in classification. The currently used binomial nomenclature was developed by Linneus.


What is the correct way to write the binomial scientific name for red maple?

The correct binomial scientific name for red maple is Acer rubrum.


How can you solve the tower of hanoi?

1. Write mathematical analysis for recursive algorithms. Solve Tower of Hanoi Problem and analyze it.


How do you write a recursive Formula?

3,6,9,12 A sub 1 = First (3) a sub n = a sub (n-1) + change (3)


Write and explain recursive backtracking algorithm for n-queens?

This is not a question, this is your homework. For a start, read this: https://en.wikipedia.org/wiki/Eight_queens_puzzle


What is the recursive rule and explicit rule for 3 12 48?

Each number is -4 times the previous one. That means that you can write a recursive rule as: f(1) = -3 f(n) = -4 * f(n-1) The explicit rule involves powers of -4; you can write it as: f(n) = -3 * (-4)^(n-1)