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
To print factorial of any<br>input number <br>QBASIC​
lukranit [14]

Answer:

The program in QBasic is as follows;

PRINT "Number: "

INPUT N

LET FACT = 1

FOR I = 1 TO N

     FACT = FACT * I

NEXT I

PRINT FACT

END

Explanation:

This prompts user for number

PRINT "Number: "

This accepts input from the user

INPUT N

This initializes the factorial to 1

LET FACT = 1

This iterates through the number the user inputs and calculates its factorial

<em>FOR I = 1 TO N </em>

<em>      FACT = FACT * I </em>

<em>NEXT I </em>

This prints the factorial

PRINT FACT

The program ends here

END

5 0
3 years ago
Can you explain why you got the error message when trying to use the command x = c\d
ASHA 777 [7]
Do You mean x= x / d   ?....because there is no " \ " in math operations
6 0
3 years ago
Using the 4 Cs, we consider where a company may decide to offer the product or service to customers. Whether online or in a phys
DanielleElmas [232]

Answer:

"Place" in the 4P's.

Explanation:

The 4C's marketing model was formulated in the year 1990 by Robert Lauterborn. The 4C's comprises of; Customer value, Cost, Convenience, and Communication. It is important to know that this marketing model is an improvement of the 4P's model.

Convenience implies that any product being marketed has to be made easily accessible to the customers. The location should also make it possible, that the product is easily seen by the customers.

Place was a concept in the 4P's model that sought to resolve the problem of where the product can be best distributed. The introduction of Convenience in the 4C's improved on it, and extended it to imply that there must be a high level of accessibility of the product.

3 0
3 years ago
Complete each statement by choosing the correct answer from the drop-down menu.
mihalych1998 [28]

Answers for edg:

1- speaking and listening

2- nonverbal communication

3. gestures often have multiple interpretations

4. interpreting body language and behavior

Explanation: hope this helped! i just did them and they were right :)

7 0
3 years ago
Read 2 more answers
Write a function merge that merges two lists into one, alternating elements from each list until the end of one of the lists has
Anna007 [38]

Explanation:

The program that merges two lists or two arrays is written below;

Code :

void main void

{

char [] arr1= {'1','2','3'};

char [] arr2= {'a','b','c','d','e'};

int l1= arr1.length;

int l2=arr2.length;

int l3=l1+l2;

char [] arr3=new char[l1+l2];

int i=0;

int j=0;

int k=0;

int m=0;

int r=0;

if(l1<l2)

   r=l1;

else

   r=l2;

while(m<r)

{

   arr3[k++]=arr1[i++];

   arr3[k++]=arr2[j++];

   m++;

}

while(k<l3)

{

   if(l1<l2)

       arr3[k++]=arr2[j++];

   else

       arr3[k++]=arr1[i++];

}

for(int n=0;n<l3;n++)

{

   System.out.print(arr3[n]+" ");

}

}

5 0
3 years ago
Other questions:
  • Tornado Alley is located in the middle of the United States, extending from Texas up through the Dakotas. The above statement is
    14·1 answer
  • Declare k, d, and s so that they can store an integer, a real number, and a small word (under 10 characters). Use these variable
    13·1 answer
  • Populate a one-dimensional array with the following grades in this order: 90, 61, 74, 42, 83, 51, 71, 83, 98, 87, 94, 68, 44, an
    15·1 answer
  • A technically qualified individual who may configure firewalls and IDPSs, implement security software, diagnose and troubleshoot
    5·1 answer
  • You work in the Accounting Department and have been using a network drive to post Excel workbook files to your file server as yo
    9·1 answer
  • Type the correct answer in the box.
    15·1 answer
  • ⦁ Consider transferring an enormous file of L bytes from Host A to Host B. Assume an MSS of 536 bytes. ⦁ What is the maximum val
    15·1 answer
  • 3. Choose the statement that best describes a ray. A ray extends forever in both directions. B ray is a part of a line with two
    10·1 answer
  • Here is the model I’m working on and can’t figure it out this model shows the basic process of making a protein what are the str
    14·2 answers
  • You want to connect to a user desktop to review windows 10 configuration settings when the user is not present. which technology
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!