1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
s344n2d4d5 [400]
3 years ago
13

Write a function called median, that takes as parameter a full, sorted array of doubles and returns the median of the list. For

a sorted list of odd length, the median is the middle value. For a sorted list of even length, the median is the average of the two middle values. Make an example function call in your main.

Computers and Technology
1 answer:
serg [7]3 years ago
3 0

Answer: Provided in the explanation section

Explanation:

#include <stdio.h>

double median(double array[] , int n)

{

double med;

//if n is even then return average of middle of two element.

if(n%2==0)

med = ( array[(n-1)/2] + array[n/2] ) /2.0 ;

else

med = array[n/2];//if n is odd return middle element.

 

return (med);

}

int main()

{

double array[6] = {1.3,3.5,5,7.7,9.0,11};

//size store size of array.

int size=sizeof(array)/sizeof(double);

//call the median function.

double medvalue =median(array, size);

printf("median is : %lf\n",medvalue);

return 0;

}

//OUTPUT : median is : 6.350000

⇒ Provided is the Image of the code and output.

cheers i hope this helped !!

You might be interested in
What will happen if a user clears the analytics cookie from their browser?
aev [14]
They won't have an analytics cookie anymore.

No, but seriously it just means that if the user revisits they'll count as a new visitor rather than a returning one, a new cookie will be generated upon their return though. This is essentially what happens when you use private browsing, the tracking cookie is created upon connection and then deleted when the user leaves.
5 0
4 years ago
If you have a second Ethernet adapter, which network location is being used by the adapter?
yuradex [85]

Answer:

Public network

Explanation:

The network includes different networks and settings for sharing which are applied to the network which you are connected to.

A public network is being used by the adapter. The public network is a network that is unrestrictive. That is, any member of the public can easily have access to it and connect to the internet. Such a network exposed users to risks by exposing the connected devices.

3 0
3 years ago
Your company is getting negative feedback on the current customer service process. It’s your job to make sure customers are happ
Andru [333]

Answer:

I would say the second one

Explanation:

it makes sense cause if you're able to fix the problem that's how. if not then the last one

4 0
3 years ago
Which of the following cannot be copyrighted?
Tju [1.3M]
Um.. Where the Answer Choices
8 0
3 years ago
Exposing employee and customer personal data to an untrusted environment is an example of:
jonny [76]

Answer:

data breach

Explanation:

A data breach is a security event in which a unauthorized person steals, copy, access or transfer personal or confidential data. A data breach is the deliberate or unintentional leak of sensitive data into an distrusted environment. When a perpetrator or cyber criminal effectively invades a data source and steals confidential information, a data breach happens. This can be achieved physically by manipulating a device or network to steal or hack local data. Data breach is being used to target companies mostly by remotely bypassing network security.Data breaches include financial and personal information, trade secrets of companies or intellectual property, files, confidential documents etc.

8 0
3 years ago
Other questions:
  • "In about 100 words, describe the idea behind software as a service (SaaS). In your answer, include at least three examples of e
    10·1 answer
  • What is DBMS software used for?
    5·1 answer
  • If you create and invoke a recursive function without accounting for a base case, what can go wrong?
    15·1 answer
  • Which of the following is the key benefit is offered by the Internet channel? Group of answer choices Deeper assortments Immedia
    7·1 answer
  • Click this link to view O NET'S Wages and Employment section for Film and Video Editors.
    11·2 answers
  • What layout manager should you use so that every component occupies the same size in the container?
    5·1 answer
  • The column boundary, the border to the right of a column, can be dragged until a row is at a desired height. true or false
    14·1 answer
  • If you were creating a program that would convert Fahrenheit to Celsius, which kind of variable would you want to use? a string
    7·2 answers
  • nder a Huffman encoding ofnsymbols with frequenciesf1, f2, . . . , fn, what is the longest a codewordcould possibly be
    13·1 answer
  • True or False: Once you rename a field, the new field name must be used in the rest of the search string.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!