Question: Program in C please. mirror x - negate a point's x coordinate 1 // Don't modify this data type Complete the program as follows. Your

Program in C please.

Program in C please. mirror x - negate a point's x coordinate

mirror x - negate a point's x coordinate 1 // Don't modify this data type Complete the program as follows. Your task is to specify a prototype for and implement a definition of a function called mirror_x. This function should take a pointer to a struct Point instance, and negate the instance's x coordinate. For example, if the point's x coordinate is originally 3.4, then after mirror_x is called, it should be equal to -3.4 2 struct Point double x, y; 4 6 // TODO: add a prototype for mirror_x here 8 Do not modify the definition of struct Point or the main function. 9 I/ IMPORTANT: don't modify the main function in any way 10 int main(void) { Author: David Hovemeyer License: Creative Commons Attribution-ShareAlike 3.0 struct Point p; scanf("%1f %lf", &p . x, mirror_x(&p); printf("Result : x-%lf, return 0; 12 13 14 15 16 17 18 II TODO: add a definition for mirror_x here 19 &p.y); y-&Lf " , p.x, p.y)

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!