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
olya-2409 [2.1K]
2 years ago
5

Write a program that reads 20 integers from the user into an array and uses a function arrayMinimum that accepts an integer arra

y along with its size as parameters and returns the smallest element of the array. The program needs to output the result (the smallest array element).
Computers and Technology
1 answer:
neonofarm [45]2 years ago
6 0

Answer:

#include <iostream>

using namespace std;

int arrayMinimum(int myArray[], int myArraySize) {

int small = myArray[0];

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

   if(myArray[i]<small){

small = myArray[i];

}

 }

 return small;

}

int main(){

   int myArray[20];

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

       cin>>myArray[i];          

   }

   cout<<"The smallest is: "<<arrayMinimum (myArray,20);

   return 0;

}

Explanation:

This solution is provided in c++

#include <iostream>

using namespace std;

This line defines the arrayMinimum function

int arrayMinimum(int myArray[], int myArraySize) {

This initializes the smallest of the array element to the first

int small = myArray[0];

This iterates through the array

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

This if condition checks for the smallest

   if(myArray[i]<small){

The smallest is assigned to the small variable

small = myArray[i];

}

 }

This returns the smallest

 return small;

}

The main method begins here

int main(){

This declares an array of 20 elements

   int myArray[20];

The following iteration allows user input into the array

<em>    for(int i =0;i<20;i++){ </em>

<em>        cin>>myArray[i];          </em>

<em>    } </em>

This calls the method and returns the minimum

   cout<<"The smallest is: "<<arrayMinimum (myArray,20);

   return 0;

}

You might be interested in
Use the drop-down menus to correctly complete these sentences about common data types.
steposvetlana [31]

Answer: Boolean, alphanumeric string, integer, floating-point number

Explanation: cuz I got it right

4 0
3 years ago
What would be the most important data to access in the HRIS for the units and divisions of the MNE to determine feasible HR prog
12345 [234]

The most important data to access in the HRIS to determine feasible HR programs is <u>personnel cost</u>.

<h3>What is HRIS?</h3>

HRIS is an acronym for human resource information system and it can be defined as a software system that is designed and developed, so as to help a business firm to collect, manage, and store detailed data on its employees or workers.

Generally, the important data to access in the human resource information system (HRIS) system for the units and divisions of the multinational enterprise (MNE) to determine feasible HR programs is personnel cost because it would affect the total amount of money that would be spent in training them on how to use the latest technology in the market.

Read more on HRIS here: brainly.com/question/23264557

7 0
2 years ago
A student is conducting an experiment in which he adds an inhibitor to an enzyme-catalyzed reaction that contains alkaline phosp
Zigmanuir [339]

Answer:

competitive

Explanation:

An inhibitor is a substance that hinders the action of an enzyme. An inhibitor may be competitive or non competitive.

A competitive inhibitor is an inhibitor that is very similar to the substrate hence it binds to the enzyme instead of the substrate. A noncompetitive inhibitor binds to a site that is different from the active site. This site is called an allosteric site.

If we look at the experiment described in the question, the reaction rate decreases upon addition of the inhibitor. This effect is reversed by adding a large quantity of substrate.

The implication of this observation is that the enzyme and the inhibitor compete for the active site on the substrate.

Hence the inhibitor is a competitive inhibitor.

7 0
2 years ago
PLEASE HELP!
Basile [38]

Answer:

declare count as integer

7 0
3 years ago
Which of the following is a good question to ask during an informational interview?
grin007 [14]
How do you know your information is valid?
8 0
3 years ago
Read 2 more answers
Other questions:
  • In a car crash, wearing a seat belt __________________.
    5·2 answers
  • __________ is a program that lets you share documents online with others.
    12·2 answers
  • Why do you think it is important to consider ethical considerations when reviewing technology and assessing the impact of partic
    9·1 answer
  • Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
    7·1 answer
  • State 4 basic operation performed by a computer​
    11·2 answers
  • I am booooooored any one want to join
    5·2 answers
  • In PowerPoint, a picture might be a photograph, a shape you draw, a piece of clip art, or an illustration created using a graphi
    7·2 answers
  • Why is a Quality assurance tester needed on a software development team?
    5·1 answer
  • How can you protect your information when using wireless technology
    10·1 answer
  • Show that ALLDFA is in <img src="https://tex.z-dn.net/?f=%5Cmathrm%7BP%7D" id="TexFormula1" title="\mathrm{P}" alt="\mathrm{P}"
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!