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 language standards? At this point in your study of programming, what do they mean to
garri49 [273]
In computing, a programming language specification (or standard or definition) is a documentation artifact that defines a programming language so that users and implementors can agree on what programs in that language mean.
5 0
3 years ago
What is the assignment operator?
cestrela7 [59]
I think hahahahaha Answer 1
4 0
3 years ago
5.
garri49 [273]

<em>The answer is : It highlights the contrast between the Dursley's excitement for the dinner and Harry's loneliness. </em>

<em> </em>

<em>Harry is a lonely boy as he must remain outcast and invisible to Dursley's visitors. During this time, Dursleys are expecting some visitors which has relation to Vernon's job. Harry must stay in the bedroom so the visitors won't see him and won't ask some things about him. Since they are having a visitor, a dinner must be served to make the visit worthwhile which is what the Dursleys are looking forward to. </em>

4 0
3 years ago
Que se encarga de notar lo que pasa alrededor
Angelina_Jolie [31]

Answer: Es nuestro cerebro. Los ojos son las estructuras capaces de transformar las señales luminosas en impulsos eléctricos, los cuales viajan al cerebro y, una vez ahí, él se encarga de transformar estas señales eléctricas en lo que vemos realmente. Y lo mismo pasa con todos los otros sentidos.

Explanation:

7 0
3 years ago
A group of users in a small publishing office want to share large image files in a common folder with high availability. Which o
mash [69]

Answer:

Network storage appliances

Explanation:

Because I just took a test

7 0
3 years ago
Other questions:
  • Categories of general purpose application software and examples each​
    13·1 answer
  • Why is the answer A?
    6·1 answer
  • Which one of these students is having a positive impact?
    8·2 answers
  • 0001 0000 1100 0011 (unsigned, that is, interpreted as b2u)i.8 bit truncated value:ii.does the value change when truncated to 8
    7·1 answer
  • A(n) ________ moves over the spinning platters to retrieve data from the hard disk.
    6·1 answer
  • Help me with this, please. Are vacuum cleaners, Cd players, and telephones considered computers? Do they store any data or proce
    8·2 answers
  • What is the first step that you have to perform before you can add a windows package to a wim file?
    9·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • Look for at least ten materials tools or anything you see at home (tle)
    14·1 answer
  • the current food label has been in place for 20 years. the fda has proposed changes to this label for a variety of reasons, such
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!