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
Convert 578.2 into hexadecimal​
Digiron [165]

Answer:

242.33333333

Explanation:

578.2

578÷16 -> 36 R 2

36 ÷16 -> 2 R 4

242.

.2 x 16 -> 3.2 F 3

.2 x 16 -> 3.2 F 3

.2 x 16 -> 3.2 F 3

.2 x 16 -> 3.2 F 3

.2 x 16 -> 3.2 F 3

.2 x 16 -> 3.2 F 3

.2 x 16 -> 3.2 F 3

.2 x 16 -> 3.2 F 3

.33333333

242.3333333

4 0
3 years ago
Which type of loop is best if you do not know how many times you need the loop to run?
Alex
While: <span> the loop must repeat until a certain "condition" is met.  If the "condition" is FALSE at the beginning of the loop, the loop is never executed.  The "condition" may be determined by the user at the keyboard.  The "condition" may be a numeric or an alphanumeric entry.  <span>This is a good, solid looping process with applications to numerous situations. 
</span></span><span>while:<span>int ctr = 1;
while (ctr < = 20)
{
     cout<< ctr++ <<"\n";
}

</span><span>
</span><span>
</span><span>HOPE i HELPED! brainliest? :D </span></span>
5 0
3 years ago
Which option correctly describes a DBMS application? A. software used to manage databases B. software used to organize files and
ahrayia [7]
The answer is A.
It's a software used to manage databases


DBMS stands for DataBase Management System
4 0
3 years ago
Read 2 more answers
I need help someone plz i need it fast ..........
photoshop1234 [79]

Answer:

Do you still need help??

Explanation:

5 0
3 years ago
Read 2 more answers
The part of the poppet valve that contacts the valve seat is called the?
Amiraneli [1.4K]
C. is the correct answer
6 0
3 years ago
Read 2 more answers
Other questions:
  • Mike is reading about machine-dependent programming languages. Which languages are machine-dependent programming languages?
    11·1 answer
  • The ____ preceding a formula alerts excel that you are entering a formula or function and not text
    14·1 answer
  • _____ include the people, procedures, hardware, software, data, and knowledge needed to develop computer systems and machines th
    11·1 answer
  • What are the OSHA construction standards also called ?
    10·1 answer
  • Choose the term that matches the action.
    5·2 answers
  • A ____ is a a set of presentation rules that control how text should look. It is applied to an XML file to change the collection
    9·1 answer
  • Read the ages of three people and find the average. Display the result.
    10·1 answer
  • I WILL MARK BRAINLEST
    7·1 answer
  • What are the minimum number of bits an address bus must have in a byte addressable memory system containing only 4 KiB of memory
    8·1 answer
  • Classes that depend on field names from parent classes are said to be ____ because they are prone to errors.Group of answer choi
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!