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
In this screenshot, the circled item is the
gavmur [86]

Answer:

Favorites tab/bar

Explanation:

6 0
3 years ago
Read 2 more answers
What is the main difference between EDBAC and EDNIAC......​
lawyer [7]

Answer:

EDVAC (Electronic Discrete Variable Automatic Computer) was the successor to ENIAC, was binary based, and used stored programs, and was also designed by Eckert and Mauchly, UNIVAC I (UNIVersal Automatic Computer I) was the first commercial computer. It was designed by the same two men who designed ENIAC and EDVAC.

Explanation:

6 0
3 years ago
Read 2 more answers
What can you say about 3s in 43,335?
Greeley [361]
That 43,335 is divisible by 3 giving a whole number as result
6 0
3 years ago
Read 2 more answers
Explain three reasons why so many different computer languages exist.<br> Pleaseeee
zmey [24]

Each language has its own use, some of them are used to create or manipulate back end codes and some of them are used mainly for web designing and some of them are used for data entries and control of data that is being implanted in the system, so if you put all uses in one language it will not be a simple task as it is nowadays for programmers. That is why there are different compt. langs.

3 0
2 years ago
Jacinta registered herself on a social-networking site. She receives one or two emails every day about promotional offers as wel
Rainbow [258]
It would be Spam. . . . 

3 0
3 years ago
Other questions:
  • Write a program that reads in two integers typed on the keyboard and outputs their sum, difference, and product.
    12·1 answer
  • The Earth's _______ is ductile overall, tending to flow very slowly and deform in a _______ manner.
    14·2 answers
  • Which game would be classified as an advergame? A. Tomb Raider B. Fifa Soccer C. Prince of Persia D. Flower
    9·1 answer
  • .Visual Studio .NET’s ___________ feature displays all the members in a class
    9·1 answer
  • How do you change the Background image or picture on Windows desktop?
    9·1 answer
  • List the operating system you recommend, and write a sentence explaining why.
    8·1 answer
  • Which programming paradigm does the programming language JavaScript follow?
    14·1 answer
  • Consider the following code:
    5·1 answer
  • Value appears on the left hand side of cell <br> true or false
    15·2 answers
  • Why is it important to prepare the farm resources before you start working? explain​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!