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
Example of negative body language include all but
Paraphin [41]

Answer:

Avoidance of eye contact.

Staring.

Crossed arms.

Overuse of hands.

Looking at watch.

Poor posture.

Frowning.

Sweating.

( but what??)

8 0
3 years ago
In order to access the internet, it is not necessary to have an Internet Service Provider (ISP).
loris [4]

Answer:

False!

Explanation:

You <em><u>have</u></em> to have an Internet Service Provider in order to access the internet! (I also got this right in my test)

<em><u>Hope this helps :]</u></em>

8 0
3 years ago
Read 2 more answers
2. Suppose a computer using direct mapped cache has 220 words of main memory and a cache of 32 blocks, where each cache block co
Advocard [28]

Answer:

(a) The block size = 16 words (b) the format for the sizes of the tag, block, and word fields are stated below:

Tag Block Offset  

11 bits 5 bits 4 bits

(c)The memory address 0DB63 will map to 22nd block and 3 byte of a block. (d)  The main advantage of the cache is, when the cache block is made larger or bigger then, there are fewer misses. this occur when the data in the block is used.

One of the disadvantage is that if the data is not used before the cache block is removed from the cache, then it is no longer useful. here there is also a larger miss penalty.

Explanation:

Solution

(a)The Cache of 32 blocks and the memory is word addressable  

The main memory size is not stated, so let's consider it as 2^20  

The main memory size = 2^20  

The block size = 16 words  

The Number of blocks = main memory size/ block size = 2^20/16. = 2^16= 64 K words.

(b) The Main memory is 2^20, which says it is 1 M words size and it requires 20 bits  

Now,

From which 32 cache block requires 2^5, 5 bits and block size means offset requires 2^4, 4 bits

Thus, the sizes of the tag, block, and word fields are stated below:

Tag Block Offset  

11 bits 5 bits 4 bits

(c)The hexadecimal address is 0DB63 , its binary equivalent is  

0000 1101 1011 0110 0011  

The tag = ( first 11 bits) = 0000 1101 101  

block = ( next 5 bits ) = 1 0110  

offset = ( next 4 bits ) = 0011  

Therefore, the memory address 0DB63 will map to 22nd block and 3 byte of a block.

(d) The main advantage of the cache is that, when the cache block is made larger or bigger then, there are fewer misses. this occur when the data in the block is used.

One of the disadvantage is that if the data is not used before the cache block is removed from the cache, then it is no longer useful. here there is also a larger miss penalty.

3 0
3 years ago
To rehearse giving a PowerPoint presentation, Hema would like to print out the presentation with all of the speaker notes. Hema
seraphim [82]

From the given case in the question, Hema would prefer having a handout document for the audience that does not include the slide dates, which are included in her printed notes for the presentation.

To do this, Hema would need to execute option (D) View → Notes and Handouts → Header & Footer → Date and time → Fixed.

This is because the option to modify dates for handouts and notes are in the View tab, not on the insert Tab.

8 0
4 years ago
True false) keybord has two shift keys.​
deff fn [24]

Answer:

True, looking at 'em right now!

Explanation:

8 0
4 years ago
Other questions:
  • A student is searching through a large box of unused cables and connectors in the classroom. The student finds a ribbon with con
    14·1 answer
  • The RAM is a type of ____ a.Main Memory b.Secondary Memory c.Human Memory d.EPROM e.EEPROM
    13·2 answers
  • Which of the following was the first commercial software package to incorporate WYSIWYG as a feature?
    15·1 answer
  • Both k-means and k-medoids algorithms can perform effective clustering. (a)Explain the strength and weakness of k-means in compa
    5·1 answer
  • If wire rope guard rails are used what must also be done?
    10·1 answer
  • Is sprint having problems today
    11·1 answer
  • How do you change your grade level
    10·1 answer
  • Explain the application software and utility software in detail​
    15·1 answer
  • During an IFR flight in IMC, you enter a holding pattern (at a fix that is not the same as the approach fix) with an EFC time of
    12·1 answer
  • What happens if the new context is in memory rather than in a register set and all the register sets are in use?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!