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
solong [7]
3 years ago
9

Write a function that receives an integer list from STL and returns the sum of even numbers in the list (return zero if no even

number is in the list)
Computers and Technology
1 answer:
Doss [256]3 years ago
8 0

Answer:

int sumeven(int lis[],int n)

{

   int sum_e=0;//integer variable to store the sum.

   for(int i=0;i<n;i++)

       {

           if(lis[i]%2 == 0)//if the number is even adding to sum_e.

           sum_e=sum_e+i;

       }

   return sum_e;//retuning the sum.

   

}

Explanation:

The above written function is in C++.This function find the sum of even numbers in the list provided.It loops over the array and if the number is even adds to the variable sum_e finally return sum_e which having the sum of even numbers now.

You might be interested in
What tab contains the copy and paste buttons
Nina [5.8K]
Any u just get the pointer and hilight it then u paste
7 0
3 years ago
Read 2 more answers
Advantages and disadvantages of using the command-line interface to manage files and folders
EastWind [94]
Some advantages are that you will have more control, you can quickly access documents and files, and you can easily preform more advance commands. Some downside are not GUI, you have to know exactly what to type to do the action you need, and you have to experience error codes sometimes with will need you to google what they mean


Hope this helps! And I hope to get brainliest!
5 0
3 years ago
Which type of software is primarily used to organize a collection of information for easy access?
weeeeeb [17]
Database - you could also use a spreadsheet but you can't ask questions that you can with a database
4 0
3 years ago
Which element is the first thing you should complete when making a movie?
AlekseyPX

Answer:

storyboard!!!

Explanation:

its important to have the concept in mind before starting

6 0
3 years ago
Read 2 more answers
Which part of the cpu holds the memory address for the next instruction to be processed?
aleksley [76]
Register, google CPU registers for more info
7 0
4 years ago
Other questions:
  • you work in the Human Resources department of a company that has partnered with a similar company in Brazil on a big contract. y
    12·1 answer
  • Define binary number and decimal number with example​
    14·1 answer
  • Why does hamlet want to kill himself and what stops him from doing that?
    10·1 answer
  • If a small monster collector has 20 small monster containment devices; intends to use all of those devices; has access to non-un
    13·1 answer
  • You can run a macro by:
    10·1 answer
  • How does a scriptwriter show the design team how different player actions should affect the game?
    6·1 answer
  • What are folders within folders called​
    8·2 answers
  • List five applications field of a computer?​
    8·1 answer
  • Hannah wants to write a book about how scientists and society interact, and she has generated ideas for chapters. Which chapter
    13·1 answer
  • Jack is part of the software quality assurance team in a company. Which activity should Jack perform as a part of software quali
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!