- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Maximum points of intersection n lines in C++

In this tutorial, we will be discussing a program to find maximum points of intersection n lines

For this we will be provided with a number of straight lines. Our task is to find the maximum number of intersections the given number of lines meet.

## Example

#include <bits/stdc++.h> using namespace std; #define ll long int //finding maximum intersection points ll countMaxIntersect(ll n) { return (n) * (n - 1) / 2; } int main() { ll n = 8; cout << countMaxIntersect(n) << endl; return 0; }

## Output

28

- Related Questions & Answers
- Maximum points of intersection n circles in C++
- Program for Point of Intersection of Two Lines in C++
- Find intersection point of lines inside a section in C++
- Plot horizontal and vertical lines passing through a point that is an intersection point of two lines in Matplotlib
- Maximum possible intersection by moving centers of line segments in C++
- Program to print last N lines in c++
- How to plot the lines first and points last in Matplotlib?
- Find the probability of reaching all points after N moves from point N in C++
- Maximum number of pieces in N cuts in C++
- Maximum sum of n consecutive elements of array in JavaScript
- Find the Number of Triangles Formed from a Set of Points on Three Lines using C++
- Maximum number of ones in a N*N matrix with given constraints in C++
- Maximum number of fixed points using at most 1 swaps in C++
- Maximum number of segments that can contain the given points in C++
- Intersection of two arrays in C#

Advertisements