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
Anna007 [38]
3 years ago
9

Create a function names minElement() that takes an array of numbers as a paaramter and returns the min value of the array. The a

rray may not be modified by the function. The array method .sort() may not be used. The function must loop through the array
Computers and Technology
1 answer:
Vika [28.1K]3 years ago
8 0

Answer:

#include<iostream>

using namespace std;

//create the function

int minElement(int arr[],int n){

   int minimum = arr[0];  //store the first value of array

   //for loop for iterate the each element

   for(int i=0;i<n;i++){

       if(arr[i]<minimum){   //compare

           minimum=arr[i];

       }

   }

   return minimum;

}

int main(){

   int arr[]={4,1,7,9,2,6};

   int array_size = 6;

   int result = minElement(arr,array_size);   //calling

   cout<<"The min value is: "<<result<<endl;

}

Explanation:

First include the library iostream in the c++ programming for input/output.

then, create the function minElement() for find the minimum value in the array.

it required the one loop for iterate the each element in the array and then compare with first element in the array which is store in the variable minimum.

if array element is less than the minimum then, update the value in the minimum variable.

after complete the loop, return the result.

for capture the result create the main function and call the function with parameter array.

and finally display the result.

You might be interested in
Write an application that allows a user to enter the names and birth dates of up to 10 friends. Continue to prompt the user for
mylen [45]
Sorry I don’t know the answer I am really sorry
5 0
4 years ago
What should you do if ads keep popping up on your computer when using Google Chrome?
romanna [79]
I think it’s B.. I’m pretty sure
8 0
3 years ago
Why is graphics important in multimedia application <br>​
erastova [34]
Graphics are important in multimedia application this is because humans are visually oriented etc.
5 0
3 years ago
Suppose that in a 00-11 knapsack problem, the order of the items when sorted by increasing weight is the same as their order whe
frosja888 [35]

Answer:

Following are the response to the given question:

Explanation:

The glamorous objective is to examine the items (as being the most valuable and "cheapest" items are chosen) while no item is selectable - in other words, the loading can be reached.

Assume that such a strategy also isn't optimum, this is that there is the set of items not including one of the selfish strategy items (say, i-th item), but instead a heavy, less valuable item j, with j > i and is optimal.

As W_i < w_j, the i-th item may be substituted by the j-th item, as well as the overall load is still sustainable. Moreover, because v_i>v_j and this strategy is better, our total profit has dropped. Contradiction.

8 0
3 years ago
RAM
Alex Ar [27]

Answer:

The answer to this question is given below in the explanation section

Explanation:

The correct answer is RAM.

RAM is used for storing programs and data currently being processed by the CPU.  So, the data in the RAM, can be easily accessible and processed by the CPU more fastly.

While Mass memory and neo volatile memory is not correct options. because these types of memory can stores a large amount of data but CPU fetch data from these memories into RAM. and, RAM can only be used by the CPU when performing operations.

7 0
3 years ago
Other questions:
  • This type of peripheral is used to interact with, or send data to, the computer.
    12·2 answers
  • Based on the passage​ and/or drawing on your prior​ knowledge, you realize that an HMO is​ what?
    9·1 answer
  • When creating a spreadsheet, there's no need to worry about design and how it will be organized; the program will take care of t
    11·2 answers
  • Framing can create which of the following in a photograph? Mystery Saturation Aperture All of the above
    10·2 answers
  • ABC software company is to develop software for effective counseling for allotment of engineering seats for students with high s
    13·1 answer
  • Arctic Gear LLC. recently adopted a new ERP​ system, but quickly found that it​ wasn't a perfect fit with their existing procedu
    14·1 answer
  • Why security must be planned, tested, and ready by the time the erp implementation is at go-live?
    11·1 answer
  • If 209g of ethanol are used up in a combustion process, calculator the volume of oxygen used for the combustion at stp​
    5·1 answer
  • Which statement best explains the way that similar apps are used in different devices?
    9·1 answer
  • Question 12 (5 points)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!