Question: The C programming Language. Please add comments to the codes when you answer. Circles as struct In this question we will represent circles with a

The C programming Language.

Please add comments to the codes when you answer.

Circles as struct

In this question we will represent circles with a struct . A circle has a certain position in a coordinate system and a radius. The position is the center of the circle.

struct circle {

int x, y ;

int radius;

};

typedef struct circle Circle ;

a) Write a function printOut (...) that takes a Circle as in - parameter and print it out to standard output. Note that this function should not load anything from the standard input. Call your function with circle from main. Create the circle as shown here: Example: A circle with position (3,2) and radius 5 print out : Circle at (3,2) with radius 5

b) Write a function named move(...) that takes a pointer to a circle and two integers (dx and dy) as in - parameters and then move the circle (i.e.,the circle the pointer points to) dx units in x - axis and dy units in y - ranks. Please note that this is an auxiliary function: it will not load anything from standard input or print something to standard output. Call your function with circle from question a ) and move it one step in x - axis and two steps in y axes before you print it

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!