Maximum points of intersection n lines | CPP program to find maximum intersecting points ; nC2 = ( n ) * ( n - 1 ) / 2 ; ; Driver code ; n is number of line
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define ll  long int NEW_LINE ll countMaxIntersect ( ll n ) { return ( n ) * ( n - 1 ) / 2 ; } int main ( ) { ll n = 8 ; cout << countMaxIntersect ( n ) << endl ; return 0 ; }