text: Program to find the mid | C ++ program to find the midpoint of a line ; function to find the midpoint of a line ; Driver Function to test above
code: #include <iostream> NEW_LINE using namespace std ; void midpoint ( int x1 , int x2 , int y1 , int y2 ) { cout << ( float ) ( x1 + x2 ) / 2 << " ▁ , ▁ " << ( float ) ( y1 + y2 ) / 2 ; } int main ( ) { int x1 = -1 , y1 = 2 ; int x2 = 3 , y2 = -6 ; midpoint ( x1 , x2 , y1 , y2 ) ; return 0 ; }