SuperTutor

(15)

$15/per page/Negotiable

About SuperTutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,Engineering,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 327 Weeks Ago, 4 Days Ago
Questions Answered: 12843
Tutorials Posted: 12834

Education

  • MBA, Ph.D in Management
    Harvard university
    Feb-1997 - Aug-2003

Experience

  • Professor
    Strayer University
    Jan-2007 - Present

Category > Programming Posted 18 May 2017 My Price 8.00

program compiles and runs with no error indication

Consider the following program. This program compiles and runs with no error indication, but its output is incorrect.  It has an error.  Which line must be changed in order for the program to produce the correct output?  

 

 

1   #include <stdio.h>2   /n arr*

Find the minimum value in aay of doubles. */

3   double

array_min (double x[], int length )

4   {

5       int i;

6       double min = 0.0;

7

8      for (i = 0; i < length; i++)

9      {

10          if (x[i] < min)

11          {

12              min = x[i];

13          }

14      }

15      return min;

16  }

17

18  int main( void )

19  {  

20      double n[] = {12.5, 17.2, 11.4, 8.1};

21      double min;

22  

23      min = array_min (n, 4);

24      printf("The minimum value is %lfn", min );

25      return 0;

26  }

 

 

line 12
line 15
line 10
line 23
line 6

Attachments:

Answers

(15)
Status NEW Posted 18 May 2017 07:05 AM My Price 8.00

-----------

Not Rated(0)