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
snow_lady [41]
2 years ago
15

Write a loop that reads positive integers from console input, printing out those values that are even, separating them with spac

es, and that terminates when it reads an integer that is not positive. Declare any variables that are needed.
Computers and Technology
1 answer:
AfilCa [17]2 years ago
3 0

#include <iostream>

#include <vector>

std::vector<int> v;

int main(int argc, char* argv[]) {

   while(1) {

   int temp;

   std::cout << "\nEnter a number: ";std::cin>>temp;

   

   if(temp<0) {

       std::cout << "\nEven number(s) is/are:\n---------------------\n";

       for(int i=0;i<v.size();i++) {

           if(v.at(i)%2==0) std::cout << v[i] << " ";

           else continue;

       }

       std::cout << std::endl;

       break;

   }else {

       v.push_back(temp);

   }

}

   return 0;

}

You might be interested in
Which of the following apply to the definition of Wide Area Networks? Check all of the boxes that apply.
zalisa [80]

Answer: Cover large geographic areas, link many networks together, known as WANs

Explanation:

Just took it got it right

7 0
3 years ago
Read 2 more answers
Explain why the computer is powerful working tool???​
notsponge [240]

Answer:

here ya go

Explanation:

A computer is a powerful tool because it is able to perform the information processing cycle operations (input, process, output, and storage) with amazing speed, reliability, and accuracy; store huge amounts of data and information; and communicate with other computers.

8 0
3 years ago
On a network, a(n) ________ helps prevent data packets from colliding with each other.
KATRIN_1 [288]
On a network, a(n) Switches helps prevents data packets from colliding with each other.
4 0
3 years ago
Computers are often referred to as _____.
GalinKa [24]
Smart machines I'm pretty sure
4 0
3 years ago
The printing press helped spread the ideas of the Renaissance.<br> a. True <br> b. False
guajiro [1.7K]
The answer is a. True

The printing press did help spread the ideas of the Renaissance, as it could spread ideas easily, quickly, and in different languages.

6 0
4 years ago
Other questions:
  • Are the advantages of a climate control in a vehicle
    10·2 answers
  • A Windows systems administrator should use the Administrator account ________.a. As little as possible, and only when needed b.
    15·1 answer
  • Membrane-bound organelles are not found in the cells of A) bacteria. B) fungi. C) plants. Eliminate D) protists.
    15·2 answers
  • What do you call when a hacker users multiple guest computers to crack a password?
    11·1 answer
  • Consider an unpipelined or single-stage processor design like the one discussed in slide 6 of lecture 17. At the start of a cycl
    10·1 answer
  • Which term describes the degree to which a network can continue to function despite one or more of its processes or components b
    8·1 answer
  • Consider the following concurrent tasks, in which each assignment statement executes atomically. Within a task, the statements o
    9·1 answer
  • What is an overview of your opinion of Digital Etiquette? Do not look it up bc I will know!
    7·1 answer
  • A pizza delivery restaurant decides to stop hiring drivers and start hiring cyclers to deliver its pizza. The restaurant thinks
    15·1 answer
  • A computer is made up of hardware and software ​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!