Given an integer **N** which denotes the points on the circumference of a circle, the task is to find the number of quadrilaterals formed using these points.

**Examples:**

Input:N = 5

Output:5

Input:N = 10

Output:210

**Approach:** The idea is to use permutation and combination to find the number of possible quadrilaterals using the N points on the circumference of the circle. The number of possible quadrilaterals will be .

Below is the implementation of the above approach:

## C++

`// C++ implementation to find the ` `// number of quadrilaterals formed ` `// with N distinct points ` `#include<bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// Function to find the factorial ` `// of the given number N ` `int` `fact(` `int` `n) ` `{ ` ` ` `int` `res = 1; ` ` ` ` ` `// Loop to find the factorial ` ` ` `// of the given number ` ` ` `for` `(` `int` `i = 2; i < n + 1; i++) ` ` ` `res = res * i; ` ` ` ` ` `return` `res; ` `} ` ` ` `// Function to find the number of ` `// combinations in the N ` `int` `nCr(` `int` `n, ` `int` `r) ` `{ ` ` ` `return` `(fact(n) / (fact(r) * ` ` ` `fact(n - r))); ` `} ` ` ` `// Driver Code ` `int` `main() ` `{ ` ` ` `int` `n = 5; ` ` ` ` ` `// Function Call ` ` ` `cout << (nCr(n, 4)); ` `} ` ` ` `// This code is contributed by rock_cool ` |

*chevron_right*

*filter_none*

## Java

`// Java implementation to find the ` `// number of quadrilaterals formed ` `// with N distinct points ` `class` `GFG{ ` ` ` `// Function to find the number of ` `// combinations in the N ` `static` `int` `nCr(` `int` `n, ` `int` `r) ` `{ ` ` ` `return` `(fact(n) / (fact(r) * ` ` ` `fact(n - r))); ` `} ` ` ` `// Function to find the factorial ` `// of the given number N ` `static` `int` `fact(` `int` `n) ` `{ ` ` ` `int` `res = ` `1` `; ` ` ` ` ` `// Loop to find the factorial ` ` ` `// of the given number ` ` ` `for` `(` `int` `i = ` `2` `; i < n + ` `1` `; i++) ` ` ` `res = res * i; ` ` ` `return` `res; ` `} ` ` ` `// Driver Code ` `public` `static` `void` `main(String[] args) ` `{ ` ` ` `int` `n = ` `5` `; ` ` ` ` ` `// Function Call ` ` ` `System.out.println(nCr(n, ` `4` `)); ` `} ` `} ` ` ` `// This code is contributed by 29AjayKumar ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 implementation to find the ` `# number of quadrilaterals formed ` `# with N distinct points ` ` ` `# Function to find the number of ` `# combinations in the N ` `def` `nCr(n, r): ` ` ` `return` `(fact(n) ` `/` `(fact(r) ` ` ` `*` `fact(n ` `-` `r))) ` ` ` `# Function to find the factorial ` `# of the given number N ` `def` `fact(n): ` ` ` `res ` `=` `1` ` ` ` ` `# Loop to find the factorial ` ` ` `# of the given number ` ` ` `for` `i ` `in` `range` `(` `2` `, n ` `+` `1` `): ` ` ` `res ` `=` `res ` `*` `i ` ` ` `return` `res ` ` ` `# Driver Code ` `if` `__name__ ` `=` `=` `"__main__"` `: ` ` ` `n ` `=` `5` ` ` ` ` `# Function Call ` ` ` `print` `(` `int` `(nCr(n, ` `4` `))) ` |

*chevron_right*

*filter_none*

## C#

`// C# implementation to find the ` `// number of quadrilaterals formed ` `// with N distinct points ` `using` `System; ` `class` `GFG{ ` ` ` `// Function to find the number of ` `// combinations in the N ` `static` `int` `nCr(` `int` `n, ` `int` `r) ` `{ ` ` ` `return` `(fact(n) / (fact(r) * ` ` ` `fact(n - r))); ` `} ` ` ` `// Function to find the factorial ` `// of the given number N ` `static` `int` `fact(` `int` `n) ` `{ ` ` ` `int` `res = 1; ` ` ` ` ` `// Loop to find the factorial ` ` ` `// of the given number ` ` ` `for` `(` `int` `i = 2; i < n + 1; i++) ` ` ` `res = res * i; ` ` ` `return` `res; ` `} ` ` ` `// Driver Code ` `public` `static` `void` `Main(String[] args) ` `{ ` ` ` `int` `n = 5; ` ` ` ` ` `// Function Call ` ` ` `Console.Write(nCr(n, 4)); ` `} ` `} ` ` ` `// This code is contributed by shivanisinghss2110 ` |

*chevron_right*

*filter_none*

**Output:**

5

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Program to calculate area of inner circle which passes through center of outer circle and touches its circumference
- Program to find Circumference of a Circle
- Count of obtuse angles in a circle with 'k' equidistant points between 2 given points
- Equation of circle when three points on the circle are given
- Program to find Perimeter / Circumference of Square and Rectangle
- Program for Circumference of a Parallelogram
- Program to calculate angle on circumference subtended by the chord when the central angle subtended by the chord is given
- Number of Integral Points between Two Points
- Minimum number of points to be removed to get remaining points on one side of axis
- Number of triangles formed from a set of points on three lines
- Number of triangles that can be formed with given N points
- Maximum area of quadrilateral
- Program to find the angles of a quadrilateral
- Exterior angle of a cyclic quadrilateral when the opposite interior angle is given
- Find the area of quadrilateral when diagonal and the perpendiculars to it from opposite vertices are given
- Check whether Quadrilateral is valid or not if angles are given
- Length of Diagonals of a Cyclic Quadrilateral using the length of Sides.
- Circumradius of a Cyclic Quadrilateral using the length of Sides
- Ways to choose three points with distance between the most distant points <= L
- Find the point on X-axis from given N points having least Sum of Distances from all other points

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.