Find the center of the circle using endpoints of diameter | C ++ program to find the center of the circle ; function to find the center of the circle ; Driven Program
#include <iostream> NEW_LINE using namespace std ; void center ( int x1 , int x2 , int y1 , int y2 ) { cout << ( float ) ( x1 + x2 ) / 2 << " , ▁ " << ( float ) ( y1 + y2 ) / 2 ; } int main ( ) { int x1 = -9 , y1 = 3 , x2 = 5 , y2 = -7 ; center ( x1 , x2 , y1 , y2 ) ; return 0 ; }