Answer to Question #43223 in C for Susanta Biswas

Question #43223
Another non recursive functions COMPLETE_LINE that will accept as input parameters the co-ordinates of two end point of straight line as has been read in by the functions READ_POINT,and then complete & returns the length of that line.
1
Expert's answer
2015-06-04T03:28:32-0400
#include<stdio.h>
#include<math.h>
double COMPLETE_LINE( double x1, double y1, double x2, double y2 ){
return pow((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1), 0.5);
}
int main(){
// example for end points (0,0) and (3,4)
printf("%lf", COMPLETE_LINE(0, 0, 3, 4));
return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS