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
When your friend DaJuan turns on his computer, he hears four beeps. The computer won’t fully boot. DaJuan has a Dell computer wi
djyliett [7]

Answer:

4 beeps indicate a Memory Read / Write failure. Try re-seating the Memory module by removing and reinserting it in the slot. This could mean it could've just jiggled loose after a while or dust, there could be a hundred other problems but those are the two most common.n:

6 0
3 years ago
Is a type of bullying that takes place when a person intentionally posts negative information about another that is not true
MakcuM [25]

Cyberbullying is bullying that takes place over digital devices like cell phones, ... posting, or sharing negative, harmful, false, or mean content about someone else. It can include sharing personal or private information about someone else ... as well as any negative, mean, or hurtful content

6 0
3 years ago
Coffee shops worldwide throw away billions of paper cups each year. Discuss
garik1379 [7]

Answer:

They should give out a coffee cup to each person and charge full price for the first time that you fill the cup but then after they finish the first drink they should offer a discount if you reuse the same cup. They should tell you that you can bring back coffee cups from even a few days ago and you could still be eligible for the discount. This way even people that don't drink as much coffee can still be eligible to get a discount on their coffee.

Explanation:

:)

4 0
2 years ago
1. Se requiere implementar un conversor unipolar que tendrá una tensión analógica variable entre 0 y 2 V pico. Deberá tener una
PolarNik [594]

Answer:

A

Explanation:

Because

7 0
3 years ago
Answers please !!!!!!!!!!!!!!!!!!!!!!!!!!!
alina1380 [7]
Hard to see please add a better image. Actually just type out the question.
4 0
3 years ago
Other questions:
  • A plan that outlines the steps and timeline for reaching a certain goal is called a(n):
    13·1 answer
  • Today, air travel allows large numbers of people to move quickly over long distances. Which of the following is a likely effect
    8·1 answer
  • The specifications for ____ are developed by the world wide web consortium (w3c) and are continually evolving.
    13·1 answer
  • Investments in data networks, ip addresses, routers, and switches are ________ because of their impact on productivity, security
    14·1 answer
  • A(n) ________ is a special value that cannot be mistaken as a member of a list of data items and signals that there are no more
    9·1 answer
  • 12. When trying to identify the sorted column in a table, you would look for the column where A. an arrow is displayed in the fi
    10·2 answers
  • HELP PLSSS I WILL MARK U!!!!
    10·2 answers
  • Who invented the Bluetooth device​
    12·1 answer
  • In a network, multiple critical paths can occur. true or false
    13·2 answers
  • Identify and state the value of hardware components​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!