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
Rufina [12.5K]
3 years ago
5

Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint:

use Mod). Displays the sum.
Computers and Technology
1 answer:
Alika [10]3 years ago
5 0

Answer:

Following are the code to this question:

#include <iostream>//defining header file

using namespace std;

int main()//defining main method

{

int x[]={2,3,4,6,7,8,9,1,11,12};//defining 1-D array and assign value

int i,sum=0;//defining integer variable

for(i=0;i<10;i++)//defining loop for count value

{

   if(x[i]%2==1)//defining if block to check odd value

   {

       sum=sum+x[i];//add value in sum variable

   }

}

cout<<sum;//print sum

return 0;

}

Output:

31

Explanation:

In the above-given program, an integer array "x" is declared that holds some integer values, and in the next line two integer variable "i and sum" is defined which is used to calculate the value.

In the next line, a for loop is declared, that counts all array value, and it uses the if block to check the odd value and add all the value into the sum variable.

You might be interested in
What was your learning target for today
Aleks04 [339]

My learning target for today are the follows :

  1. I learn at least 2 words meaning that I don't know.
  2. I learn coding daily at least 10mins
  3. Some quotes
8 0
3 years ago
Read 2 more answers
You use worksheets to perform calculations. How do you perform these calculations?
Elena-2011 [213]
The main function you will use is.... Type SUM= in all caps into a cell and then you can control click cells to add them together. You can also add PEMDAS properties to do calculations withing it.
5 0
3 years ago
Read 2 more answers
Find the median and mean of the data set below: 29 17 40 12 29
quester [9]

answer:

median: 29

arrange the data in ascending order, and the median is the value in the middle. If there are an even number of values, the median would be the product of the two middle numbers. (12, 17, 29, 29, 40)

mean: 25.4

the mean of a set of numbers is the sum divided by the number of terms.

12 + 17 + 29 + 29 + 40 = 127 / 5 = 25.4

hope this helped!

6 0
2 years ago
Which term describes the process by which light passes through an object or a medium.
Licemer1 [7]
For anyone reading this in the future, the correct answer is transmission. I just took the quiz 
5 0
3 years ago
Read 2 more answers
Question 1(Multiple Choice Worth 5 points)
vlabodo [156]

Answer:

Information assurance

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, etc.

Information assurance is a broad category that is typically used by cybersecurity or network experts to protect sensitive user information such as passwords, keys, emails, etc., in both digital and hard-copy forms

6 0
3 years ago
Other questions:
  • Describe how using active listening at work can help you be a better employee.
    15·1 answer
  • Dr. Patterson’s office calls to give patient Sara Martin her test results from her most recent visit. Her husband answers the ph
    8·2 answers
  • Suppose you were assigned to develop a logical model of the registration system at a school or college. would you be better off
    9·1 answer
  • When you purchase software in a box, reading the ________ is important to know if the software will function properly?
    13·1 answer
  • What should be used to clean LCD monitors? Liquid window cleaner Ammonia wipes Windshield washer liquid Antistatic monitor wipes
    15·1 answer
  • This is in government
    15·1 answer
  • Does anyone know a way to skip the videos on Edgnuity?
    15·1 answer
  • The _____ of a local variable is the function in which the variable is created.
    6·1 answer
  • If a document is stored on a file server but team members can edit the document​ anonymously, the content on the file server is:
    14·1 answer
  • What software application is most appropriate to use to create multimedia presentations?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!