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
With which type of social engineering attack are users asked to respond to an email or are directed to a website where they are
kirza4 [7]

Answer:

Phishing

Explanation:

Phishing is a social engineering attack where users are asked to respond to an email or are directed to a website where they are requested to login with their personal credentials, such as passwords or credit card numbers.

How Phishing Works?

The attacker first carefully designs a web page identical to a real bank with fine details. Then attacker persuades the victim to go to this fake web page with login screen. The attacker gets all the information typed and enter into that fake web page. The victim often thinks that this is exactly my bank's web page so nothing is going to happen if I put log in credentials.

How to avoid Phishing?

This kind of attack can always be spotted with one simple trick. Check the address of the web page carefully. The attacker can design the web page according to his wish but he cannot have control over the web address of a real bank or real a website.  

Some general safety tips are:

  • Don't open links from spam emails.
  • Don't download malicious software.
  • Don't share personal information with strangers
7 0
3 years ago
What effect would excluding quotation marks from a search phrase have?
n200080 [17]

Answer: C

 it would broaden the search

Explanation:

Placing quotation marks around a search term or phrase limits your search to that exact term or phrase. Without the quotes, your search engine may return all results that contain each separate word. Placing AND between your keywords will return results that only include both or all your keywords.

4 0
2 years ago
Most file managers include a way to create a folder through the save dialog box. true or false?
Illusion [34]

Answer:

false because most of the file managers just keep Everything organized by dates, years, and everything like that

Explanation:

5 0
2 years ago
Using your favorite imperative language, give an example of each of the following. (a) A lexical error, detected by the scanner
Travka [436]

Explanation:

a. int foo+; (foo+ is an invalid identifier because + is not a valid char in identifiers)

b. foo int; (Syntax error is any error where the syntax is invalid - either due to misplacement of words, bad spelling, missing semicolons etc.)

c. Static semantic error are logical errors. for e.g passing float as index of an array - arr[1.5] should be a SSE.

d. I think exceptions like NullReferenceException might be an example of DME. Not completely sure but in covariant returns that raise an exception at compile time (in some languages) might also come in this category. Also, passing the wrong type of object in another object (like passing a Cat in a Person object at runtime might qualify for DME.) Simplest example would be trying to access an index that is out of bounds of the array.

8 0
2 years ago
During which part of geologic time did photosynthesis evolve?
m_a_m_a [10]
During Archean part of geological time photosynthesis evolve.
8 0
3 years ago
Read 2 more answers
Other questions:
  • A musical compact disc is an example of
    13·1 answer
  • What does intergrated organization mean
    15·1 answer
  • A speaker takes a variety of information from the results of a web search, and puts it together in an outline to make up his spe
    8·1 answer
  • What are interpersonal skills?
    12·2 answers
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • Swiping and pinching are graphical user interface (gui) _____________.
    7·2 answers
  • At each layer of the OSI model, data is appended to the original message and then sent on to the next lower layer. What is this
    10·1 answer
  • Pride Group of Companies is making tremendous profits in different categories of electronic goods. The group of managers have to
    12·1 answer
  • Non linear editing can cause _____ where edit and re-edit and re-edit again can cause video to be less true than the original ma
    11·1 answer
  • Assume the name of your data frame is flavors_df. What code chunk lets you review the structure of the data frame?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!