Driver program to test above functions
int main ( ) { struct Point p1 = { 1 , 1 } , q1 = { 10 , 1 } ; struct Point p2 = { 1 , 2 } , q2 = { 10 , 2 } ; doIntersect ( p1 , q1 , p2 , q2 ) ? cout << " Yes STRNEWLINE " : cout << " No STRNEWLINE " ; p1 = { 10 , 0 } , q1 = { 0 , 10 } ; p2 = { 0 , 0 } , q2 = { 10 , 10 } ; doIntersect ( p1 , q1 , p2 , q2 ) ? cout << " Yes STRNEWLINE " : cout << " No STRNEWLINE " ; p1 = { -5 , -5 } , q1 = { 0 , 0 } ; p2 = { 1 , 1 } , q2 = { 10 , 10 } ; doIntersect ( p1 , q1 , p2 , q2 ) ? cout << " Yes STRNEWLINE " : cout << " No STRNEWLINE " ; return 0 ; }