CODE
#include <iostream.h>
#Include <stdlib.h>
#include <math.h>
Int main ()
{ system (“CLS”)
;
Double distance,
x1,y1,x2,y2 ;
Cout <<
“Enter coordinates ( x y) of point 1 : “ ;
Cin >>
x1 >> y1 ;
Cout <<
“Enter coordinates ( x y) of point 2 : “ ;
Cin >>
x2 >> y2 ;
Distance
= sqrt ( x1 – x2 ) * ( x2- x2 ) + (y1 – y2) * (y1- y2) ) ;
Cout <<
“ The Distance between (“<<x1 <<”,”<<y1<<”) and (“<<x2<<”,”<<y2<<”)
is : “ << distance << endl ;
Return 0 ;
0 comments:
Post a Comment