Question: Using the structure below, write a C program to do the following: [1] The main function should first prompt the user for the coordinates of

Using the structure below, write a C program to do the following: [1] The main function should first prompt the user for the coordinates of the center and a point on the circumference of a circle and then read in those coordinates. [2] The main function should then call the function area to compute and return the area of the circle. [3] The main function should print the area of the circle. [4] The main function should then call the function circumference to compute and return the circumference of the circle. [5] The main function should print the circumference of the circle.

struct point

{

float x, y;

};

struct circle

{

struct point centerpt, cirpt;

};

Note1: Given the two points (x1, y1) and (x2, y2), the distance between these points is given by the formula:

d = SQRT[(x2 x1)2 + (y2 y1)2]

Note2: Be sure to link the Math library when you compile your program by using -lm.

$gcc rp6.c o rp6 -lm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!