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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started