Wlcome to the blogging tifani

Program C++ Menghitung jarak antara dua titik

Rabu, 22 Oktober 20141komentar

#include<iostream.h>
#include<conio.h>
int main()
{
int x1,x2,y1,y2,d;
cout<<"\t\t===-----------------------------------==="<<endl;
cout<<"\t\t|MENGHITUNG JARAK ANTARA DUA TITIK |"<<endl;
cout<<"\t\t===-----------------------------------==="<<endl;
cout<<"Input x1 : ";cin>>x1;
cout<<"Input x2 : ";cin>>x2;
cout<<"Input y1 : ";cin>>y1;
cout<<"Input y2 : ";cin>>y2;
d=(sqrt(x2-x1)*(x2-x1))+(y2-y1)*(y2-y1);
cout<<"Jarak antara dua titik tersebut : "<<d;
getch();
}


Share this article :

+ komentar + 1 komentar

6 Januari 2023 pukul 16.46

Menarik, blog saya juga membahas hal yang serupa, namun dengan judul
Program Menghitung Jarak Dengan C++

Posting Komentar

 
Support : Cara Gampang | Creating Website | Johny Template | Mas Templatea | Pusat Promosi
Copyright © 2015. TIfanie - All Rights Reserved
Template edited by Creating Website Modify by Teknologi Informasi kinie
Proudly powered by Blogger