/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/
#include<stdio.h>
#include<math.h>
main()
{
double x1,y1,x2,y2,d;
scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
d=sqrt(((y2-y1)*(y2-y1))+((x2-x1)*(x2-x1)));
printf("%.4lf\n",d);
return 0;
}
//Happy_Coding
#include<stdio.h>
#include<math.h>
main()
{
double x1,y1,x2,y2,d;
scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
d=sqrt(((y2-y1)*(y2-y1))+((x2-x1)*(x2-x1)));
printf("%.4lf\n",d);
return 0;
}
No comments:
Post a Comment