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]
2 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]2 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
Putting commands in correct order so computers can read the commands
lana66690 [7]

Answer:

its b I think I'm pretty sure

8 0
2 years ago
HELP ME PLEASE !!!!!!!!!!
Snezhnost [94]

Answer:

the last one

Explanation:

8 0
3 years ago
7. Malware could A. cause a system to display annoying pop-up messages B. be utilized for identity theft by gathering personal i
beks73 [17]

Answer:

D

Explanation:

Malware can be used for many things, a click of a button can send complete access to the attacking system. Malware comes in all formes and powers.

4 0
2 years ago
What information can be determined from a device's MAC address?​
rewona [7]

Answer:

I believe it is the NIC manufacturer and the serial number of the NIC

Explanation:

5 0
3 years ago
In two to three paragraphs, come up with a way that you could incorporate the most technologically advanced gaming into your onl
Marina CMI [18]

nobody cares about plagiarism dude

7 0
3 years ago
Other questions:
  • What is the difference between a denial-of-service attack and a distributed denial-of-service attacks? which is potentially more
    10·1 answer
  • Can someone tell me how to get all A's with no effort?
    5·1 answer
  • What keyword do we use when instantiating an object _________________
    15·1 answer
  • Which diagram is used as a popular technique for investigating causes and effects? 1. Cause and effect 2. Fishbone/lshikawa 3. R
    13·1 answer
  • Write a program to output a big A like the one below
    12·1 answer
  • For C++ ONLY please,
    14·1 answer
  • Which web browser was created by Google?
    5·2 answers
  • The Advanced Properties sheet enables you to add which of the following?
    15·1 answer
  • Damion recently did an update to his computer and added a new video card. After the update, Damion decided that he would like to
    14·1 answer
  • What are the fundamental activities that are common to all software processes?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!