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]
2 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]2 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 is the default font style of “Title” box in MS PowerPoint 2013?
butalik [34]

Answer:

A) Calibri Light

Explanation:

After Office 2013, All versions of PowerPoint title font is "Calibri Light"

7 0
2 years ago
Which of the following provides astronomical evidence for the age of the earth?
Anestetic [448]

A. movement of galaxies

3 0
2 years ago
What is the velocity of a 0.100kg car with a momentum of 5 kgm/s?
Cerrena [4.2K]

Answer:

v = 50 m/s

Explanation:

p = mv

5 = 0.1v

v = 50

4 0
2 years ago
Write a program that displays in the title of the window the position of the mouse as the user moves the mouse around the window
12345 [234]
The java program displays these 
4 0
3 years ago
Circuit-switched networks provide connection between two parties that: Group of answer choices is dedicated for use by the parti
loris [4]

Answer:

The answer is "The first choice"

Explanation:

The circuit switches are used to provide a network that connects among the two parties, which are dedicated for the use to the parties for the length of the connection. It is a familiar technique, that is used to create a network for communication, which is used on telecalls. It also enables the hardware and circuits to share among the users, and for every user, it has direct access to the circuit during the use of the network.

7 0
2 years ago
Other questions:
  • Why does people that gets abused not report?
    5·1 answer
  • Which one of these variables has an illegal name?
    11·1 answer
  • Which scenario depicts an ethical workplace practice by a business owner? A. sharing personal information of its employees with
    8·2 answers
  • Write a program that asks the user to enter two integer numbers X and Y. The program halves each number between X and Y then pri
    15·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    9·1 answer
  • Find the basic period and basic frequency of the function g(t)=8cos(10πt)+sin(15πt)
    9·1 answer
  • Why do we need to make a plan before actions?
    7·1 answer
  • EASY POINTS who is your favorite in family<br> 1. mom<br> 2. dad<br> 3. sister<br> 4. brother
    10·2 answers
  • There is a file of a few Sean Connery movies on the internet. Each entry has the following form:
    9·1 answer
  • What type of databases is not limited by the data’s physical location?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!