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
Umnica [9.8K]
3 years ago
6

Write a function called printEvens that prints all the even numbers between 2 and 20, inclusive. It will take no arguments and r

eturn nothing. You must also use a looping statement in the code to get credit for printing (i.e. no cout << 2 << " " << 4 " " << ...).
Computers and Technology
1 answer:
nataly862011 [7]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

void printEvens() {

   for (int i = 2; i <= 20; i++) {

       if (i % 2 == 0)

           cout << i << " ";

   }

}

int main() {

   printEvens();

   return 0;

}

Explanation:

- Inside the function, initialize a for loop that <u>goes from 2 to 20</u>.

- Inside the for loop, check if the <u>numbers are divisible by 2</u>. If yes, print the number

- Inside the main, call the function

You might be interested in
What are some ways to insert a row or column? Check all that apply.
kondaur [170]

Answer:

There are two ways to insert the new column or row in the table.

Explanation:

<u>Method I</u>

i. Select the cell where you want to add a new row or column,

ii. Click on Home Tab

iii. Find insert button in Cells Group.

iv. Click on Insert Row or Insert Column button.

By following above mentioned steps we can add a row or column in Excel sheet.

<u>Method II</u>

i. Select the cell where you want to add a new row or column,

ii. Right Click on the selected Cell.

iii. Find Insert Button in drop down menu and Click on Insert.

iv. There are four options in POP menu, choose Entire Row or Entire Column to insert row or column.

4 0
3 years ago
Read 2 more answers
Robert's computer is not starting due to an error in the BIOS. Which of these chips could have malfunctioned? Select the correct
timofeeve [1]

Hi;

In the question, Robert gives the explanation that there is an error in the BIOS. A BIOS (Standing for Basic Input & Output System) is a ROM chip, and is vital for the computer to initialize devices such as RAM, the CPU, etc. If there is ever an error there, a computer simply cannot boot.

From the options given, your answer given would be C. ROM.

I hope this helps!

8 0
3 years ago
3. An organization wants to use the private network number 192.168.90.0 across four subnets. The maximum number of hosts that ex
lesya [120]

Answer:

The correct answer is: 255.255.255.192.

Explanation:

A subnet mask complements an Internet Protocol (IP). Thanks to subnet masks IP addresses can be identified because they seem to be all the same but the subnet mask avoids confusion. If four subnets are to be created for the IP 192.168.90.0 3 bits of that IP must be used to create the subnet resulting in 255.255.255.192. Then:

  • <em>Number of subnets</em>: 2^{3} - 2 = 6
  • <em>Number of hosts per subnet</em> = 2^{5} -2  = 30
3 0
3 years ago
A customer uses an app to order pizza for delivery. Which component includes
ankoles [38]

~frestoripongetosarangeou

5 0
1 year ago
This is your code.
Tju [1.3M]

Answer:

dog

Explanation:

Given the code :

>>> A = [21, 'dog', 'red']

>>> B = [35, 'cat', 'blue')

>>> C = [12, 'fish', 'green']

>>> E = [A, B, C]

the value of E[0][1]

Here, square boxes is used to select the value at E[0] ; the output is then used to select the value at index 1 of E[0] output.

Note that, indexing starts at 0; hence first list element is 0, then, 1, 2, and so on.

At

E[0] ; list E, index 0 (first element in the list) , gives an output A

Then, A[1] ; list A, index 1 (second element in the list) gives 'dog'

4 0
3 years ago
Other questions:
  • True or False? A supervisory control and data acquisition (SCADA) device is a computer that controls motors, valves, and other d
    13·1 answer
  • Tommy has hired a marketing company to create a billboard advertisement
    11·2 answers
  • Which of the following tasks would a database administrator perform ? A identify computer security photos, B. Make sure protocol
    15·1 answer
  • To insert a new slide in an existing presentation, what menu should you select?
    5·2 answers
  • A user states that when they power on their computer, they receive a "Non-bootable drive" error. The user works with external st
    8·1 answer
  • (Game Design) Which of the following is NOT a name of a popular digital sculpting application?
    13·1 answer
  • Anyone wanna play among us UwU code is TAEQPQ
    15·2 answers
  • In which situation would saving a Word document as a PDF be most useful?
    9·2 answers
  • Complete the procedure for pasting content from a Word document in a message by selecting the correct term from
    7·2 answers
  • What are the three main elements common to all radio ads?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!