subject

Enter the following code to calculate the distance between two points on the x, y plane. The program asks a user to enter 2 points, then calculates the distance between the 2 points and prints out the distance on the screen. You need to replace any "?" with the appropriate code. #include #include - Since you are using the math library, you'll need to include the -Im option when compiling, for example: gec extra4.c-Im-o extra4 struct point float x; float y: }; float distance (struct point, struct point); void enter_a_point ( struct point *); int main (void) struct point pti, pt2; enter_a_point(?); //get x 6 y values for pti enter_a_point(?): //get x & y values for pt2 printf( "Distance between the points=4.2f\n", distance(?, ?) ); return 0; Distance Formula float distance (struct point p1, struct point p2) 4 = (x - x) + (y - y) return sart pow( ?, 2) - powl ?, 2)); < void enter_a_point ( struct point p) printf("\nEnter an X coordinate: "); scanf("f", ?); printf("\nEnter a y coordinate: "); scanf("%f", ?);

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
The “rule of 72” is used to approximate the time required for prices to double due to inflation. if the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. for instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years. write a program to test the accuracy of this rule. for each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate. (assume prices increase at the end of each year.)
Answers: 1
question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
Define a function printfeetinchshort, with int parameters numfeet and numinches, that prints using ' and " shorthand. ex: printfeetinchshort(5, 8) prints: 5' 8"
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
What software programs are used to to create professional publication? a.) graphics programs b.) word processors c.) page layout programs d.) spreadsheet programs
Answers: 2
You know the right answer?
Enter the following code to calculate the distance between two points on the x, y plane. The program...
Questions
question
Advanced Placement (AP), 23.09.2021 05:10
question
Mathematics, 23.09.2021 05:10
question
Social Studies, 23.09.2021 05:10
Questions on the website: 13722363