Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

function called MinMax ( ) is used to determine the smallest andlargest valued e

ID: 3613714 • Letter: F

Question

function called MinMax ( ) is used to determine the smallest andlargest valued elements given three floating point variables. Anexample of how it is called is shown below:

void main(void)
{
      float a,b,c,smallest,largest;

      printf("enter 3 numbers:  ");
     scanf("%f%f%f",&a,&b,&c);

     MinMax(a,b,c,&smallest,&largest);

      printf("Smallestvalue=%f ",smallest);
      printf("Largestvalue=%f ",largest);
}

write an implementation of the MinMax () function.

Explanation / Answer

please rate - thanks #include #include void MinMax(float,float,float,float*,float*); int main() {      float a,b,c,smallest,largest;       printf("enter 3 numbers:  ");      scanf("%f%f%f",&a,&b,&c);      MinMax(a,b,c,&smallest,&largest);       printf("Smallestvalue=%f ",smallest);       printf("Largestvalue=%f ",largest); getch(); return 0; } void MinMax(float a,float b,float c,float* small,float* large) {*small=a; *large=a; if(b>*large)     *large=b; else if(b*large)     *large=c; else if(c