hey there,
the first function would be something like the following code. but keep one thing in mind that the user will have to enter some ending value to denote the end of input and this has to be mentioned while taking the input from the user. This is called the Sentinel value. :)


#include <stdio.h>

#include <conio.h>

#include<math.h>

using namespace std;


float distance(float,float,float,float);

void main()

{

float calculate,input1,input2,input3,input4;

//take user inputs here,

calculate=distance(input1,input2,input3,input4);

cout<<calculate<<endl;

return 0;

}


float distance(float input1,float input2,float input3,float input4)

{

float result,diff1,diff2,addition;

diff1=input3input1;

diff2=input4input2;

diff1=diff1*diff1

diff2=diff2*diff2;

addition=diff1+diff2;

result=sqrt(addition);

return result;

}

I'm supposed to :
1. Write a function “distance” that takes four arguments corresponding to the Cartesian Coordinates of two points (x1, y1) and (x2, y2), and returns the distance between the two points.
 Call your function from a main program (write a complete program)
 Your program should execute iteratively till a Sentinel value is types
2. Write a function LCD (Least common divisor) that takes as input three integers, and returns the least common divisor of the three integers.
 Call your function from a main program (write a complete program)
 Your program should execute iteratively till a Sentinel value is types