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
sweet-ann [11.9K]
3 years ago
6

Write a program that declares an array named myArray with 8 components of the type int. Initialize the array to 8 values that th

e user inputs (remember to prompt the user). Finally, pass the array as a parameter to a new function called filterEvens. This new function will display all of the even numbers in the array.
Computers and Technology
1 answer:
Savatey [412]3 years ago
6 0

Answer:

#include <iostream>

using namespace std;

void filterEvens(int myArray[]) {

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

     if(myArray[i]%2==0){

         cout<<myArray[i]<<" ";

     }

  }

}

int main(){

   int myArray[8];

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

       cin>>myArray[i];

   }

   filterEvens(myArray);

   return 0;

}

Explanation:

The solution is provided in C++

#include <iostream>

using namespace std;

The function filerEvens is defined here

void filterEvens(int myArray[]) {

This iterates through the elements of the array

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

This checks if current element is an even number

     if(myArray[i]%2==0){

If yes, this prints the array element

         cout<<myArray[i]<<" ";

     }

  }

}

The main begins here

int main(){

This declares an integer array of 8 elements

   int myArray[8];

The following iteration allows input into the array

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

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

<em>    }</em>

This calls the defined function filter Evens

   filterEvens(myArray);

   return 0;

}

You might be interested in
Monica is teaching herself to paint. What web resource would be the most helpful
strojnjashka [21]

Answer:

Video Tutorial

Explanation:

The others don’t make sense.

3 0
3 years ago
Before you can use the Management Studio to work with the objects in a database, you must ___________ the database files (i.e.,
Lelu [443]

Answer:

You must attach the database files

Explanation:

4 0
3 years ago
You want to be super private with your email. You'd like to be able to download your email to a single device, then remove it fr
DENIUS [597]

Since the person want to be super private with your email, the email protocol can you use to do that is POP 3.

<h3>What is  POP3 about ?</h3>

POP3 is known to be a tool that gives one room to be able to download email to a single device, which a person want to use if they want to add privacy to their emails.

Therefore, Since the person want to be super private with your email, the email protocol can you use to do that is POP 3.

Learn more about email from

brainly.com/question/24688558

#SPJ1

8 0
2 years ago
What is one advantage of using the sharing tab vs. the security tab to give out permissions?
Hoochie [10]

Answer:

Depending on what operating system you have my best choice would be D since on some folders you can share permissions with other people. It really depends on what computer you're talking about.  

8 0
3 years ago
first 2 questions are true or false the last question is multiple choice. 7th grade work. plz only answer if u know.
pshichka [43]

#4 is true

We use pseudocode to help us understand code.

#5 is false

Strings are surrounded by quotes, integers are not.

#6 is 100.

Integers are numbers with no decimal places.

3 0
3 years ago
Other questions:
  • Which IPv6 transition technology can be used with NAT routers and has the address prefix 2001::32?
    10·1 answer
  • I need a idea of a origami for my coding class and it needs to be easy to make
    15·2 answers
  • Please help i really need to turn this in already
    6·1 answer
  • Hanging out with friends, watching your favorite TV show, and buying a pair of new shoes are all examples of _____ for doing wel
    5·2 answers
  • A coworker asks your opinion about how to minimize ActiveX attacks while she browses the Internet using Internet Explorer. The c
    14·1 answer
  • I can create spreadsheets in Google Draw. False True
    14·2 answers
  • Which button will allow you to insert quotes and notes into text into a document​
    12·1 answer
  • What piece of software tells the operating system how to use a specific hardware device? a. User interface b. System service c.
    14·1 answer
  • Which mark is an indicator of invalid data in a cell?
    11·1 answer
  • How is cell phone usage changing American Society? Is this a good change or a bad change? Explain.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!