#include <iostream.h>
int main()
{
float x, x1, x2, y, y1, y2;
cout << "titik x1 : ";cin >> x1;
cout << "titik x2 : ";cin >> x2;
cout << "titik y1 : ";cin >> y1;
cout << "titik y2 : ";cin >> y2;
x = (x1+x2)/2;
y = (y1+y2)/2;
cout << "titik tengah garis x1 dan x2 :"<<x<<endl;
cout << "titik tengah garis y1 dan y2 :"<<y<<endl;
cout << "titik tengah kedua garis antara (x1,y1) dengan (x2,y2): ("<<x<<","<<y<<")"<<endl;
return 0;
}
0 comments:
Post a Comment