text: Maximum points of intersections possible among X circles and Y straight lines | C ++ program to implement the above approach ; Driver code ; Number of circles ; Number of straight lines ; Function Call
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; int maxPointOfIntersection ( int x , int y ) { int k = y * ( y - 1 ) / 2 ; k = k + x * ( 2 * y + x - 1 ) ; return k ; } int main ( ) { int x = 3 ; int y = 4 ; cout << ( maxPointOfIntersection ( x , y ) ) ; }