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
Peripherals can be used to input information. True False
MariettaO [177]

True, cause its actual job is to either be used as an input or output device in various ways but I hope this helps ma friend :)


6 0
3 years ago
Read 2 more answers
Which of the following is a key aspect of any IT position? installation of fiber optic cables
romanna [79]
Computer maintenance
4 0
2 years ago
Read 2 more answers
Header and footer elements such as worksheet name, current date, and time are _____ elements, they change as your worksheet does
mario62 [17]
<span>Header and footer elements such as worksheet name, current date, and time are dynamic elements, they change as your worksheet does. Because the information they </span><span>contain ( page number, date,) changes that's why they are dynamic. Otherwise if the information was fixed, they would be static elements.</span>
7 0
3 years ago
What operating system do most users use?
marta [7]

Explanation:

Most of the users uses Windows. It still holds the title as world's most used operating system.

4 0
3 years ago
Select the statements that are true regarding the future of technology. Select 2 options.
oee [108]

The answers are B and D

hope this helps

8 0
3 years ago
Read 2 more answers
Other questions:
  • Text, numbers,graphics, sounds entered into a computer's memory during input operations are referred to as
    11·1 answer
  • A half-life is the amount of time it takes for a substance or entity to fall to half its original value. Caffeine has a half-lif
    10·1 answer
  • In the lan protocol architecture the _________ layer is responsible for detecting errors and discarding any frames that are in e
    13·1 answer
  • In the table below identify the data type that would be most suitable for the second field
    14·1 answer
  • A coworker asks your opinion about how to minimize ActiveX attacks while she browses the Internet using Internet Explorer. The c
    14·1 answer
  • Write a calculator program that keeps track of a subtotal like real calculators do. Start by asking the user for an initial numb
    12·1 answer
  • Henry, a graphic artist, wants to create posters. Which software should Henry use for this purpose?
    13·1 answer
  • How does calculate() work?
    6·2 answers
  • What is the full form of 'Rom<br>​
    7·2 answers
  • The best way to take control of the first page of Google is to
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!