fork download
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. float x1,x2,y1,y2;
  6. float x3,y3,l1,l2,l3;
  7. printf("enter value of x1,y1");
  8. scanf("%d%d",&x1,&y1);
  9. printf("enter value of x2,y2");
  10. scanf("%d%d",&x2,&y2);
  11. l1 = sqrt(pow((x2-x1),2)+pow((y2-y1),2));
  12. printf("%f\n",l1);
  13. x3=(float)l1/2;
  14. y3=(float)sqrt((l1*l1)-(x3*x3));
  15. printf("(x3,y3) is %f,%f\n",x3,y3);
  16. l2 = sqrt(((x3-x2)*(x3-x2))+((y3-y2)*(y3-y2)));
  17. l3 = sqrt(((x1-x3)*(x1-x3))+((y1-y3)*(y1-y3)));
  18. printf("%f %f %f",l1,l2,l3);
  19. if(l1==l2==l3)
  20. printf("it is equi");
  21. else
  22. printf("it is not equi");
  23. return 0;
  24. }
Success #stdin #stdout 0.02s 1680KB
stdin
0.0
0.0
6.0
8.0
stdout
enter value of x1,y1enter value of x2,y22.528981
(x3,y3) is 1.264491,2.190162
2.528981  3.757147  4.174555it is not equi