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
Artist 52 [7]
3 years ago
14

Write a function that returns a pointer to the maximum value of an array of float ingpoint data: double* maximum(double* a, int

size) If size is 0, return NULL.
Computers and Technology
1 answer:
Andru [333]3 years ago
5 0

Answer:

double * maximum( double arr[], int size){

   int max = 0;

   if ( size == 0){

       return 0;

   } else {

        for (int i = 1; i < size; i++){

           if (arr[i] > arr[0]){

               max = arr[i];

           } else {

               max = arr[0];

           }

         }

         return max;

   }

}

Explanation:

The C++ source code above returns the maximum value of an array as a pointer. The function accepts two parameters, the array in question and the size of the array. The for loop iterates over the items in the array and checks for the largest, which is returned as a pointer since the function "maximum" is defined as a pointer to the floating-point number memory location.

You might be interested in
Two different names that refer to the same data item best defines:
Nezavi [6.7K]
You could call that a reference or a pointer.
5 0
3 years ago
Find the number of times a value appears in a list, and create a new list that contains the index positions where the value occu
Maru [420]

Answer:

Program :

list_1=[]#take the empty list.

size=int(input("Enter the size of the list: "))#take the size of the list from the user

for x in range(size): #for loop which insert the elemnt on the list.

   list_1.append(int(input("Enter the "+str(x+1)+" element of the list: ")))#take the user input and insert the element.

element=int(input("Enter the element to be searched: "))#it take the elemnt to search.

loc=1#intialize the location value.

count=0

for x in list_1:#for loop to check the element.

   if(x==element): #check the element.

       print(loc,end=", ")#print the location of the element.

       count=count+1

   loc=loc+1

if(count==0):

   print("The element is not present on the list")#print when elemnt are not present.

Output:

  • If the user input 5 for the size and 1,2,3,4,5 for the list and 5 for the element, then it will print 5.

Explanation:

  • The above code is in python language which is used to take the size for the list, then take the value to add on the list.
  • Then the element is entered from the user to search on the list.
  • Then the element is searched on the list with the help of for loop.
  • It prints the location when the element is matched.

3 0
3 years ago
Please solve this,this is a scratch 2.0 question<br><br>The _______ shows the output of a script ?​
rusak2 [61]

Answer:

Console

Explanation:

Not sure exactly what scratch 2.0 is but the console is a separate window that shows the script's outputs and in some cases collect inputs, show error messages or display other info depending on what compiler you used

7 0
3 years ago
Sql injections is an attack in which __ code is inserted into strings that are later passed to an instance of sql server.
jek_recluse [69]

Answer:

malicious code

Please Mark Brainliest If This Helped!

7 0
2 years ago
The name of the opening that lets light into any camera is called ________.
Arturiano [62]
The answer would be : t<span>he shutter.
</span>
Hope this helps !

Photon
8 0
3 years ago
Read 2 more answers
Other questions:
  • Select the correct answer. Which sentence best describe an effective management strategy? A. Conceal game-related clippings prio
    12·2 answers
  • Hw to gain more knowledge ​
    6·1 answer
  • What college degrees did Steve Wozniak earn?
    10·1 answer
  • Select the correct answer. One of the functions of a data warehouse is to change table names to meaningful names. Which name is
    13·1 answer
  • As Alexa types a message, Outlook autosaves the message at various points. In which folder is the message located if Alexa wants
    15·2 answers
  • In this problem you will test and analyze the following sorting algorithms: Selection, Bubble, Insertion, Merge, and Quick. You
    14·1 answer
  • Use the drop-down menus to select the type of goal described in each statement. I want to finish all of my social studies homewo
    14·1 answer
  • When you evaluate the use of digital media, how has it affected the newspaper business? The rise of digital media has caused new
    15·1 answer
  • Is this statement true or false?
    5·1 answer
  • what is cicada 3301? i will give brainliest if you give me a correct answer (not copy and pasted) and somewhat well detailed, i
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!