77 457
Assignments Done
Successfully Done
In July 2019

Answer to Question #42616 in C for Ahmad

Question #42616
calculating the shortest distance between a given point and a circle in a 2D coordinate space-using structures. Distance = |sqrt( (P_X - Center_X)^2 + (P_Y - Center_Y)^2) - Radius|
I am expected to write the structure definitions and the code that generates the distance result.
Please help me complete this program, some parts are editable and some are uneditable:

input: 0 0 2
input: 3 4
output: 3.00


int main(){
point p;
circle c;
float dist;

scanf("%f%f%f",&(c.center.X), &(c.center.Y), &(c.r));
scanf("%f%f",&(p.X), &(p.Y));


return 0;
Expert's answer

Not answered

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions