answersLogoWhite

0


Best Answer

Assume that all your data were saved in array of type double and size 100:

int arrSize = 100;
double arr[arrSize] = {0.0};
...
for(int i = 0;...)
{
...
cin >> arr[i];//here you enter all elements using loop for

}
...

Out side of the function main you can define two functions max and min which take the array arr as argument

double min(const arr[], int arrSize)
{
double minimum = arr[0];
for (int j = 0; j < arrSize; j++)
{
if (minimum > arr[j])
{
minimum = arr[j];

}

}

return minimum;

}

double max(const arr[], int arrSize)
{
double maximum = arr[0];
for (int j = 0; j < arrSize; j++)
{
if (maximum < arr[j])
{
maximum = arr[j];

}

}

return maximum;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c function for minimum and maximum value from the given input?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What name is given to the turning point also known as the maximum or minimum of the graph of a quadratic function?

vertex


What are extremes in math?

the first or the last term of a proportion or series. a relative maximum or relative minimum value of a function in a given region.


Find the range of the set of numbers?

Find the minimum and maximum values from the given data. Then range is the difference between maximum and minimum values.


What is an argmax?

An argmax is a mathematical term for the argument of the maximum - the set of points of a given argument for which a given function attains its maximum value.


How many days between the minimum and the maximum of the tidal range in any given area?

14


Define range in mathematics?

The range is the maximum value in a given data minus its minimum value


What is the meaning of range in mathmatics?

Range is the difference between maximum and minimum values of a given a set of values


How do you draw a flowchart to find maximum and minimum of given 3 input numbers?

You draw a flowchart to find maximum and minimum of given 3 input numbers by using all three numbers. You take the low, high and input the middle number between them. You can see the rise, or decline of the chart that way.


What is the principle of maximum-minimum thermometers?

The advantage is the thermometer records a daily maximum and minimum temperature for reference. The disadvantage is the thermometer must be reset each day.


What is production and cost analysis in managerial economics?

According to Prof.Stigler the production function "is the name given to the relation ship between the rates of input and the rate output ".More precisely, it refers to maximum quantity of output that can be secured from the minimum quantities of inputs.


How do you Write a exponential function using the given points (-324)(-212)?

-112


What is the 2013 CA workers compensation officer maximum and minimum?

The California state compensation program is calculated on the priors year income of the injured worker. Then the worker is given between 60- 80 percent of the previous year salary.