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
MAXImum [283]
3 years ago
5

print out the last even number from an array of integers, if there is no even number, then print out a sentence indicating so.

Computers and Technology
1 answer:
den301095 [7]3 years ago
6 0

Answer:

See the sample algorithm below.

Explanation:

array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 22];

function last_even(arr) {

    for( i = arr.length-1; i >= 0; i--) {

         if (arr[i] % 2 == 0) {

              console.log(arr[i]);

              break;

         }

         else {

              console.log("There is no even number!");

         }

    }

}

last_even(array);

You might be interested in
Which leader of the Jamestown colony am I?
faltersainse [42]
I am not completely sure, but I believe that the leader of the Jamestown colony described in this paragraph is John Rolfe.
7 0
3 years ago
Read 2 more answers
A pointing device controls the movement of the ____.
andrey2020 [161]
<span>A pointing device controls the movement of the </span>Mouse Pointer
3 0
3 years ago
When performing actions between your computer and one that is infected with a virus, which of the following offers No risk of yo
daser333 [38]

Answer:

d

Explanation:

7 0
3 years ago
বর্তমান করােনার ন্যায় পরিস্থিতি অর্থাৎ স্বাভাবিক শ্রেণি কার্যক্রম পরিচালনা সম্ভব
Zarrin [17]

Answer:

ayo fam

Explanation:

I dont think this is supposed to be here lol

5 0
3 years ago
Read 2 more answers
The technique of ________ uses three columns that allows the entrepreneur to weigh both the advantages and the disadvantages of
Mekhanik [1.2K]
Force-field analysis
5 0
3 years ago
Other questions:
  • Please help?!
    11·2 answers
  • This device is used to connect sections of large networks?
    12·2 answers
  • PMI is a: computer program used to help managers write mission statements. rule of thumb used to determine how many employees sh
    15·1 answer
  • When Russ opened a website on his browser, he saw an error that the site was not compatible with the browser version he was runn
    9·1 answer
  • Paul has been working long hours. He is tired and distracted by family issues,
    10·1 answer
  • The design of a blog refers to:
    8·1 answer
  • Implement a program called genes.py that does the following: a. Reads a DNA sequence t as command-line argument b. Reads strings
    9·1 answer
  • What is the main purpose of a web crawling program
    15·1 answer
  • Pls help I will mark you the brainliest
    9·2 answers
  • Complete the sentence based on the given information.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!