Write a program for 2D points Create a struct for 2D points (x, y) that can have
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a program for 2D points
- Create a struct for 2D points (x, y) that can have values of type double
- Get 2 points from user
- Calculate distance between the points
- Find the mid-point of the 2 points
- You should have different functions
- Get input from user and save in struct
- Calculate distance between the points
- Create and return a new point which is the mid-point of the input two points
/* a4.c file */
#include<stdio.h>
#include"point.h"
int main(int argc, char *argv[])
{
int N=2;
Point points[2];
// Call a function which gets N points from user
// Find distance between two points and print it here
// Call a function that calculates mid-point for two input points and returns the new point. Print this mid-point here.
return 0;
}
/* point.h file */
/* point.c file */
Related Book For
Posted Date: