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 is the most recognized and widely used database of published nursing practice literature?
faust18 [17]
That would be the <span>Cumalitive Index to Nursing and Allied Health Literature.</span>
7 0
3 years ago
Complete the sentence to identify advantages of top-down programming design. Choose all that apply.
yanalaym [24]

Answer:The original choice to write apply_fg so that it accepts function arguments is a good one, because it increases interoperability. When the callable arguments to apply_fg use a single protocol, we can easily exchange them: #include <functional> float log2(float); int a = apply_fg(5.Of, int b = apply_fg(3.14f,

Explanation:

3 0
4 years ago
Read 2 more answers
13. The Save As command is useful if you want to copy an open document and
Marina86 [1]
A. give the copy a new name
6 0
3 years ago
Read 2 more answers
Add me on fornite buddies Lynn_.25
Anna007 [38]

i- why would u ask that

Explanation:

6 0
3 years ago
Read 2 more answers
There are nearly ____ billion people in the world who do not have internet access.
o-na [289]
<span>There are nearly 4.2 billion people in the world who do not have internet access.</span>
6 0
4 years ago
Other questions:
  • A company that hires only American Indians is practicing
    5·2 answers
  • Upon combustion a .8009 g sample of a compound containing only carbon hydrogen and oxygen produced 1.6004 g of CO2 and .6551 g o
    10·1 answer
  • Using the ____ browsing mode offered by some browsers can prevent personal information from being left on a public computer.
    9·1 answer
  • Input numbers and segregate them by placing their values into even or odd vectors based upon their value being even or odd. Then
    12·1 answer
  • Makes it possible to distribute both power and data using ethernet cabling. select one:
    12·1 answer
  • What is the symbol for the relational operator 'equal to'?
    8·1 answer
  • Which describes how media and networks interact
    12·1 answer
  • What describes a relationship between edge computing and cloud computing?
    6·1 answer
  • When you start a new blank document, you begin typing at the
    6·1 answer
  • Decision support systems (or DSSs) model information using OLAP, which provides assistance in evaluating and choosing among diff
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!