Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Binomial Coefficient in java
Binomial coefficient (c(n, r) or nCr) is calculated using the formula n!/r!*(n-r)!. Following is the Java program find out the binomial coefficient of given integers.
Program
import java.util.Scanner;
public class BinomialCoefficient {
public static long fact(int i) {
if(i Output
Enter n value:
8
Enter r value:
3
c(8, 3) :56
Advertisements
