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
Bas_tet [7]
2 years ago
5

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:
zvonat [6]2 years ago
4 0

Hello, since you did not specify a programming language, I wrote this algorithm in C++. Good luck!

<h2>Code:</h2>

#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
15 _____ 3 = 0 Question 11 options: a) / b) % c) * d) //
Vesnalui [34]
The option B is correct
5 0
3 years ago
How is ( a || b ) &amp;&amp; c || ( a || b ) &amp;&amp; ( ! c ) equal to ( a || b ) without simplification?
kogti [31]

Answer: You can see the truth table in the image.

Explanation:We can do this question by using truth table.

As we can see in the truth table that there is no effect on the output of the expression by c if a and b both are false then the output is false and if any of them is True or both of them are True then the result is True.

8 0
3 years ago
Which of these factors needs to be considered when filming in HD?
mihalych1998 [28]

Answer:

I'm going to go with b but there's a 25% thats wrong.

3 0
3 years ago
Which branch structure does a program use to output "Yes" if a variable's value is positive, or "No" otherwise?
Digiron [165]

Answer:

Selection control structure

Explanation:

This is often referred to as if-conditional statement;

This condition tests for a condition and performs a sequence of operation depending on the result of the condition;

Take for instance, the following program written in python

<em>x = int(input("enter any number: "))</em>

<em>if x < 0:</em>

<em>   print("Yes")</em>

<em>else</em>

<em>   print("No")</em>

<em />

The above checks if the input number is less than 0,

If the condition is true, it prints Yes

If otherwise, it prints No

6 0
3 years ago
A backup of sewage in the operations storeroom would be a reason to contact the local regulatory authority because it is conside
CaHeK987 [17]
65, for sure, the number at the end of the rectangle is the q3
6 0
4 years ago
Read 2 more answers
Other questions:
  • Write a program that takes as input an arithmetic expression followed by a semicolon ";". The program outputs whether the expres
    11·1 answer
  • In the web address www.microsoft, the "" is the _____ meaning _____. A. B. C. D. Group of answer choices top-level domain (TLD);
    6·1 answer
  • Which of the following is the key benefit is offered by the Internet channel? Group of answer choices Deeper assortments Immedia
    7·1 answer
  • Create a program that will read in a Salesperson name, employment status (1=Full-time AND 2=Part-time) and the sales amount.
    5·1 answer
  • What option from the format tab should you use to remove unwanted parts of a picture
    8·1 answer
  • Discuss briefly four types of websites and the criteria you will use to evaluate the content of a website
    8·1 answer
  • The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is st
    8·1 answer
  • Write a program that displays the average temperature and the annual precipitation for a selected city. The user should be able
    10·1 answer
  • Where deep convolutional neural network is used in real life
    13·1 answer
  • Fill in the missing terms relating to computer software
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!