The mathematics teacher has recently taught the formula for computing the distance between 2 points to her students. She gave them an asssignment on calculating the distance between the points. In order to prevent copying, she gave each student a different set of questions. But she found it very difficult to correct all 100 assignments. She seeks your help. Can you please help her out?
Answers
Answered by
1
SHE IS REALLY MAD SHE COULD HAVE MADE A SEETING ARRANGEMENT SO NOBODY COULD CHEAT , LOL.
Answered by
1
Answer:
#include <stdio.h>
#include<math.h>
int main()
{
int x1,y1,x2,y2,x3,y3;
float xy,yz,zx;
scanf("%d",&x1);
scanf("%d",&y1);
scanf("%d",&x2);
scanf("%d",&y2);
scanf("%d",&x3);
scanf("%d",&y3);
xy=sqrt(pow((x2-x1),2)+pow((y2-y1),2));
yz=sqrt(pow((x3-x2),2)+pow((y3-y2),2));
zx=sqrt(pow((x1-x3),2)+pow((y1-y3),2));
printf("Length of side AB is %.1f\n",xy);
printf("Length of side BC is %.1f\n",yz);
printf("Length of side AC is %.1f\n",zx);
return 0;
}
Similar questions