Question: need help with enterVector - C Language .int getNumDims() This function asks for an integer between 1-10. It keeps asking while the number the user

need help with enterVector - C Language

need help with enterVector - C Language .int getNumDims() This function asks

.int getNumDims() This function asks for an integer between 1-10. It keeps asking while the number the user enters is outside of this range. It returns the entered number when it is valid. .void enterVector (const char* arrayName, float* array, int arrayLen) This function lets the user enter the arrayLen numbers of array array with name arrayName float computeDistance (float* array0, floats array1, int arrayLen) This function computes and returns the distance between both vectors. (The formula for this is sqrt( sum(i-0.arrayLen-1, (array0i]-arrayi)) . int main () Given below: // Compile with: // gcc multiDimDist.c -1m -o multiDimDist #include #include #include math. h> const imt /I YOUR CODE HERE int main TEXT LEN - 64 int float* float* numDims-getNumDims () vectA - (float)calloc(numDims,sizeof(float)); vectB =(float*)calloc (nunDims , sizeof(float)); enterVector("vector A",vectA,numDims); enterVector("vector B",vectB,numDims); printf("The distance between vector A and vector B is %g ", computeDistance(vectA,vectB,numDims) free(vectB); free(vectA); return(EXIT SUCCESS)

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!