menu bar

Sunday, 20 March 2016

progrma mencari titik tngah 


dalam c++

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
float A,B,x1,x2,y1,y2;
cout<<"===menghitung nilai garis tengah==="<<endl<<endl;
cout<<"masukan nilai x1 ="; cin>>x1;
cout<<"masukan nilai y1 ="; cin>>y1;
cout<<"masukan nilai x2 ="; cin>>x2;
cout<<"masukan nilai y2 ="; cin>>y2;

A=(x1+x2)/2;
B=(y1+y2)/2;

cout<<"Nilai tengah garis pada koordinat ("<<A<<" , "<<B<<")";



return 0;

}



dalam reptor


No comments:

Post a Comment