Created
April 5, 2016 10:06
-
-
Save alonzoibarra97/8f4f49b94ab149b859741b8c88b70141 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
int distancia (int x2, int x1, int y1, int y2) | |
{ | |
int dis, d; | |
dis= d = sqrt((pow((x2-x1),2))- (pow((y2-y1),2))); | |
return dis; | |
} | |
using namespace std; | |
int main () | |
{ | |
int dis,x1,x2,y1,y2; | |
cout<< "Give two point so I can tell you the distance between them\n"; | |
cout<< "x1 is:\n "; | |
cin>> x1; | |
cout<< "x2 is:\n "; | |
cin>> x2; | |
cout<< "y1 is:\n "; | |
cin>> y1; | |
cout<< "y2 is:\n "; | |
cin>> y2; | |
dis= distancia(x1,x2,y1,y2); | |
cout<< "the distance is: "<< dis; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment