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
ANEK [815]
4 years ago
8

Write a function that determines the maximum and minimum values from a one-dimensional array. Assume that the corresponding func

tion prototype statement is void ranges(int x[], int npts, int *max_ptr, int *min_ptr) where npts contain the number of values in array x, and max_ptr and min_ptr are pointers to the variables in which to store the maximum and minimum values in the array.
Computers and Technology
1 answer:
erica [24]4 years ago
8 0

Answer:

void ranges(int x[], int npts, int *max_ptr, int *min_ptr)

{

   *max_ptr=*min_ptr=x[0];

   for(int i=1;i<npts;i++)

   {

       if(x[i]>*max_ptr)        //this will put max value in  max_ptr

           *max_ptr=x[i];

       if(x[i]<*min_ptr)  //this will  put min value in min_ptr

           *min_ptr=x[i];

   }

}

Explanation:

The above function can be called like :

                                    ranges(x,n,&max,&min);  

where x is array and n is number of elements and max and min are address of variables where maximum and minimum values to be stored respectively.

You might be interested in
Keisha wants to change the font color on the 1st and 3rd bullet items on slide 6 of her allied health presentation. what is the
Mice21 [21]
Is to tie them up together with a
7 0
4 years ago
I NEED HELP ASAP IM BAD AT THIS
ra1l [238]

A float is a floating point number. This means that's the number has a decimal place. Numbers with or without decimal places can be stored in a float variable but more commonly numbers with decimal points.

The correct choices are 1 and 3.4

4 0
3 years ago
Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
nata0808 [166]

Answer:

Following are the program for the above question in python:

Explanation:

def seat(num_rows,num_cols):#function definition.

   for x in range(1,num_rows+1):#first for loop.

       c='A'

       for y in range(1,num_cols+1): #second for loop.

           print(str(x)+c,end=" ") #print the value

           c=chr(ord(c)+1) #expression to form a charater addition.

seat(int(input("enter the number of rows: ")),int(input("enter the number of columns: "))) #take the input from the user.

Output:

  • If the user inputs 2 and 3, then the output is :"1A 1B 1C 2A 2B 2C 3A 3B 3C 4A 4B 4C".

Code Explanation :

  • The above code is in python language, in which the first line is used to render a message to the user then take the inputs from the user and then pass to the function after converting into int function.
  • Then there are two loops in the function which are used to print the number of the seat.
  • The first loop is used to print the row number and the second loop is used to print the column number.
4 0
4 years ago
Your sister has just emailed you an attached file with the invitation list for her upcoming party.
Andreyy89

Answer:

The file Extension so the answer is C

5 0
2 years ago
Read 2 more answers
You can use any font when creating your website as all users can see the same fonts.
Anastaziya [24]
False, think about the people with low vision. Think about the font and what size it would have to be,the color (ex. yellow would not be good), Spacing, tracking etc. Just a few things to consider.
3 0
3 years ago
Other questions:
  • What do you call the combination of title, description, tags, and thumbnail?
    6·1 answer
  • The wired or wireless means of connecting a computer to the internet is called a ________.
    9·1 answer
  • The part of the computer that provides access to the internet is the
    10·1 answer
  • What is the minimum number of data points you should usually have to look for signs of improvement on a run chart?
    8·1 answer
  • What is the color of red?
    9·2 answers
  • When creating a documentary, what is not an appropriate source for footage?
    11·1 answer
  • Which of the following blocks allows a user to enter text in a text box in App Inventor?
    6·1 answer
  • Which of the following statement is true? Single choice. (2 Points) Views are virtual tables that are compiled at run time All o
    12·1 answer
  • Write a function named partfthat takes inas parameterstwo parallel lists: a list of times (in increasing order), and a list of d
    7·1 answer
  • A company has employees who write down passwords, which should be kept private, on sticky notes. Given this scenario, what shoul
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!