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
Your grandmother was an established artist and left you several original paintings after she died. Which of these statements is
BaLLatris [955]
Copyright protection lasts the artist’s life and +70 years but if it was made from 1922-1978 it lasts 95 years form the date of publication
6 0
3 years ago
Mightier than the waves of the sea is his love for you
Inessa05 [86]

cool but kinda creepy ngl

8 0
3 years ago
It is safe to tell an online acquaintance (someone you have never met in person) your
Anna [14]
It is safe to give out information that the other user can't use to track you. Generally, these include favorite music, favorite bans, hobbies.

It is never safe to give our personal and identifying information about yourself. This includes your full name (in most cases), place of residence, or any other contact information you may have - such as social media information.

D. Favorite music
7 0
3 years ago
Read 2 more answers
A person or company that pays you to do something for them is your _____.
Andrew [12]

Answer:

client

Explanation:

client is someone that needs help

6 0
3 years ago
Read 2 more answers
N an AWS design template, the "depends on" property of a resource is represented by an _________ color dot. Red Orchid Blue Blac
CaHeK987 [17]

Answer:

Black

Explanation:

Explicit dependencies in Amazon Web Services are used to determine the order in which resources are added or deleted on AWS Cloud Formation. If a user wishes to create explicit dependency, a line from the "dependson" dot located at the route is moved to the gateway-VPC attachment.

The "dependson" dot helps to specify which resource is created before another. It is signified by a black dot (*). It can be used to override parallelisms and also to determine when a wait condition becomes activated.

4 0
3 years ago
Other questions:
  • Think of a game you are familiar with and identify at least three team responsibilities which were required to make the game, on
    5·1 answer
  • A _____________ is used to make a deep copy of an object.
    6·1 answer
  • True or false: Sony is the company behind the creation of the ‘Super Mario Bros.' franchise.
    8·2 answers
  • To enable a compute or device that does not have built-in networking capability, use a(n) ______.
    13·1 answer
  • Write a method max() which take a generic singly linked list as an argument and returns the maximum element reference in the lis
    10·1 answer
  • What’s the process of observing someone actually working in a career that interests you?
    15·1 answer
  • You are trying to connecting your laptop to your new 52" LED TV using an HDMI connector. When you connect everything, you immedi
    15·1 answer
  • Write an expression whose value is the concatenation of the three strigs name1, name2, and name3, separated by commas
    9·1 answer
  • Convert the following decimal number into octal number-147​
    11·1 answer
  • What is the output of this program?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!