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
What features are offered by most of the email programs with for receiving and sending messages?
Varvara68 [4.7K]

Answer:

The main features of email is, (1) Attachment :Ability to attach the files along the messages is one of most useful features of email. (2)Address book: It is also most important features of email that allows a user to storing the information.

Explanation:

3 0
2 years ago
What is the primary purpose of endnotes?
mihalych1998 [28]

Answer:

They acknowledge the source of a quotation, paraphrase, or summary; and (2) They provide explanatory comments that would interrupt the flow of the main text.so its B

5 0
2 years ago
Read 2 more answers
Which of the following can indicate what careers will be enjoyable ?
pishuonlain [190]

Answer: c. Interests

Explanation:

A person's interests are things that they love to do because they find those things to be enjoyable for example, gaming, writing or travelling.

To find out what careers a person would find enjoyable therefore, the interests can be looked at because if the person enjoy doing those things without it even being a job then they would probably enjoy those things in a career setting as well. For instance a person who enjoys writing would probably find a career in jornalism to be enjoyable.

5 0
3 years ago
• The technical support department at your company has informed you that you will be receiving a new computer within the next we
alexdok [17]
1) back up your data
2) delete any personal information
3) clear cookies, browsing data, and saved passwords
4) restore any settings you may have changed to original settings
6 0
2 years ago
PLEASE PLEASE HELP. IF THERE A MULTUPLE ANSWERS I WILL BRAINLIEST TO THE BEST ONE!!!!
sladkih [1.3K]

Answer: multiple answers but here is one

Explanation: The Advantages

One of the biggest advantages of ebooks is the fact that they require no trees to create them. This is obviously an eco-friendly option that both reduces cost and lowers environmental impact.

Information can be obtained without leaving your desk! Need to do some last-minute research on a particular topic? Simply find a great ebook store, search for your keywords or phrases, purchase the book and you’re set!

Unlike paper books and materials, digital books only require one device to carry around with you. This means you can carry a library of various book genres for every mood.

eBooks can lower the cost of enjoying your favorite titles. With no shipping and handling costs, eBooks typically have prices that are 50-60% lower than their print counterparts.

eBooks are more flexible than paper books. For those who have trouble reading the typical book-sized font, ebook readers can enlarge the font size to make reading more pleasurable and easier on the eyes.

eBooks can contain multi-media elements not available with traditional books. Audio and video can be embedded to make reading a fully immersive experience.

Ever wonder where that great passage in your favorite book went to? With ebooks you can mark passages, save pages and search text before, during or after you read.

With all these advantages it is difficult to imagine what the disadvantages are, but there are some that have many folks concerned. If you're already sold, we've listed the cheapest prices for the Amazon Kindle below.

The Disadvantages

Piracy is the number one concern for both publishers and authors. While traditional books can be copied with machines, the time and cost of doing so typically keeps this type of piracy at bay. With ebooks, however, 'sharing' books that have not been purchased with others is as easy as posting a file online or, in some cases, copying and pasting the text from one document to another.

Many people still prefer being able to hold a traditional book in their hands. For those of us who enjoy reading a book in bed before signing off for the night, a cold hard digital device just won’t be the same.

While one advantage of ebook devices is their ability to enlarge fonts for easier reading, the fact is you are still reading off an LCD screen. Some readers have matte e-ink screens, but others give off a glare that can not only make reading inconvenient if the lighting isn’t just right, but may actually cause eye strain and make it more difficult to focus while reading.

With the wide variety of formats and ereader devices on the market, choosing which device is the right one for all situations can be nearly impossible. Though compatible formats have been introduced that should allow most readers to view purchases, many of these still lack proper formatting. Without proper page layouts and spacing reading becomes more of a tedious chore than an enjoyable pastime. With traditional books one simply buys and reads!

When is the last time you had to plug your paper book into the wall outlet? How disappointing would it be to find yourself right in the middle of a steamy romance scene while traveling only to have the batteries in your reading device die, with no way to charge them?

Currently, ebooks have an unreliable life span. Paper books last for decades provided they are well cared for. And besides, what good is a bookshelf if you cannot enjoy the look and smell of all your time-worn books, lovingly thumbed, crimped and read cover to cover, over and over again?

7 0
2 years ago
Other questions:
  • True / False
    5·1 answer
  • Does Windows 7 support secure boot in UEFI? Windows eight? Linux UBUNTU version 14?
    8·1 answer
  • What is the duty of business to contribute to the well-being of society
    12·1 answer
  • Who is a software engineer
    8·2 answers
  • True or false? Compared to verbal language a shot is like a word
    12·1 answer
  • Using your favorite imperative language, give an example of each of the following. (a) A lexical error, detected by the scanner
    5·1 answer
  • The words that follow a code number in the cpt manual are called the
    12·1 answer
  • What is the action of extracting data fragments and then reassembling them in order to recover a file?.
    10·1 answer
  • You are working at the help desk and you get a message that a user cannot access the internet. you open a command prompt, ping t
    7·1 answer
  • in ____ structures, the computer repeats particular statements a certain number of times depending on some condition(s).
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!