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
Juli2301 [7.4K]
3 years ago
6

Write a function that returns a pointer to the MAXIMUM value of an array of double values. If the array is empty, return NULL. d

ouble* maximum(double *a, int size) { }
Computers and Technology
1 answer:
marusya05 [52]3 years ago
8 0

Answer:

double* maximum(double *a, int size) {

if(size == 0)

return NULL;

int i;

double max = 0.0;

double *mp;

for(i = 0; i < size; i++){

if(a[i] > max){

max = a[i];

mp = &a[i];

}

}

return mp;

}

Explanation:

You iterate through the vector and find the maximum value. You go updating the pointer throughout the loop. I am going to write a C function

double* maximum(double *a, int size) {

if(size == 0)

return NULL;

int i;

double max = 0.0;

double *mp;

for(i = 0; i < size; i++){

if(a[i] > max){

max = a[i];

mp = &a[i];

}

}

return mp;

}

You might be interested in
If your computer has a ________, someone else can gain access to it undetected.
irinina [24]
<span>If your computer has a rootkit, someone else can gain access to it undetected.
</span>The term rootkit denotes a set of software tools <span>typically malicious.
 The purpose of this software is to enable access to a computer or areas of its software that is not otherwise allowed.
</span><span>It is one of the most difficult types of malware to find and remove.</span>
3 0
3 years ago
Suppose that each country completely specializes in the production of the good in which it has a comparative advantage, producin
djverab [1.8K]

Answer:

In  this case, the country that produces rye will produce 24 million bushels per week, and the country that produces jeans will produce 64  million pairs per week.

Explanation:

Total labor hour = 4 million hour

Number of bushes produce in 1 hour = 6

⇒total bushes produce = 6*4 = 24 million

∴ we get

The country that produces rye will produce 24 million bushels per week

Now,

Total labor hour = 4 million hour

Number of pairs produce in 1 hour = 16

⇒total bushes produce = 16*4 = 64 million

∴ we get

The country that produces jeans will produce 64  million pairs per week.

5 0
3 years ago
White meat and dark meat fish have slightly different nutritional characteristics. What are the nutrition characteristics of dar
Marina CMI [18]

The nutrition characteristics of eating darker meat of fish like Salmon are that it is higher in healthy Omega-3 fats. It is true, however, that as much as it has the highest Omega-3 fats, it is also likely to be highest in any potential toxins.






7 0
3 years ago
Read 2 more answers
Which of the following documents cannot be created using the Microsoft® Word® application?
denis23 [38]
The correct answer is C. Customer spreadsheet
7 0
4 years ago
Read 2 more answers
Does a newer game work on older computer
babunello [35]
I don't think so because the old computers may have not been to date as what we have now but check it out and see.
5 0
3 years ago
Other questions:
  • Ryan is looking at investment opportunities as a cloud service provider. He wants to invest in a deployment-based cloud model th
    11·2 answers
  • Betty took her friends bowling. they rented 4 lane. 10 people need rent shoes and
    12·1 answer
  • What are some characteristics of filtering junk email in Outlook 2016? Check all that apply.
    9·2 answers
  • dentify the type of observational study​ (cross-sectional, retrospective, or​ prospective) described below. A research company u
    5·1 answer
  • How many 16ths are in 3/8 of an inch
    12·1 answer
  • Be my friend plzzzzzzz
    7·2 answers
  • What is a slide master ?
    8·2 answers
  • Last week, a disk containing CSM Tech Publishing’s current project manuscripts crashed. Fortunately, there was a backup, but all
    15·1 answer
  • How to design remote access policy using the appropriate access controls for systems,applications, and data access
    6·1 answer
  • What is data intergrity​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!