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
antoniya [11.8K]
3 years ago
7

An array, numbers, of integers is filled with 100 random numbers whose values are greater than 10 and less than 255. You DO NOT

have to write code to generate the random numbers. Write the code to count how many of the even numbers in the array are greater than 10 and less than 157 (inclusive).
Computers and Technology
1 answer:
Virty [35]3 years ago
4 0

Answer:

int counter = 0;

for(int i =0;i<100;i++){

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

if(myarr[i] > 10 && myarr[i]<157){

counter++;

}

}

}

cout<<counter;

Explanation:

The question is answered using c++ and it assumes that the array name is myarr

This line initializes counter to 0

int counter = 0;

This iterates through the array

for(int i =0;i<100;i++){

This checks if current array element is even number

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

If the above condition is true; This checks if the array element is within the range of 10 and 157 (inclusive)

if(myarr[i] >= 10 && myarr[i]=<157){

If yes, the counter is increased by 1

counter++;

}

}

}

This prints the total counter number

cout<<counter;

You might be interested in
Qu'est-ce qui motive le choix d'une autre?
Monica [59]

Actions are important because they have real-world consequences, but in seeking to understand our own and other people’s actions, it works better to have an understanding of how an action is motivated by the beliefs and values that underlie it.

Explanation:

  • The reason or reasons one has for acting or behaving in a particular way. Motivation is also defined as the general desire or willingness of someone to do something.
  • It is crucial for all of us to realize that motivation is a choice. It is entirely up to us to motivate ourselves to do what it takes to reach our goals.
  • Everything you need is in your mind, and you alone can influence that feeling of motivation
  • People exhibit roughly equal amounts of love and selfishness, and we identify people whose balance is more loving or more selfish and make choices about which we want more of in our own lives.
  • The motivation scale is one way of thinking about how we gain what we want and who is affected by our choices.
  • Your values, priorities, purpose, goals, drive, learning, love, and hope all live in motivation.
8 0
3 years ago
Which of the following gestures would you use if you want to activate a link on your new tablet?
Gre4nikov [31]

Answer:

press and hold

Explanation:

When you press and hold, some open a menu where you can add a link

8 0
3 years ago
During an interview, your non-verbal communication (body language, gestures, tone of voice, speed of talking,
kompoz [17]

Answer:

True

Explanation:

People will judge you based upon your non-verbal communication. If your non-verbal communication is bad then you might not get the job.

8 0
4 years ago
Write a grammar for the language consisting of strings that have n copies of the letter a followed by the same number of copies
Mazyrski [523]

Answer:

def language(mystring, n):

   if n > 0:

       string_list = [x for x in mystring]

       string_cont = ""

       for character in string_list:

           string_cont += character * n

       print(string_cont)

Explanation:

When n is equal to 0, that is, n=0, The python program multiplies the characters of the string "mystring" by the integer variable "n" to output a string with all characters with the same count.

7 0
3 years ago
Using underlining and italics at the same time is which of these? A. allowed but might be overkill B. always a good idea C. not
Alex777 [14]

A. Allowed but might overkill

6 0
3 years ago
Read 2 more answers
Other questions:
  • Complete the function ConvertToFeetAndInches to convert totalInches to feet and inches. Return feet and inches using the HeightF
    5·1 answer
  • What can help establish the focus and organization it relies on?
    6·1 answer
  • Write a function that accepts a list as an argument (assume the list contains integers) and returns the total of the values in t
    10·1 answer
  • A ___________ assigns levels of risk to various threats to network security by comparing the nature of the threats to the contro
    9·1 answer
  • Define Indentation
    8·1 answer
  • What are some excuses for not attending online classes ( for students )​
    13·1 answer
  • Interface elements include but are not limited to:
    8·1 answer
  • Pick one of the following scenarios and
    6·1 answer
  • Write long answer to the following question. a. Define microcomputer. Explain the types of microcomputers in detail.​
    5·2 answers
  • HELP!!!!!!!!!! I'M SOO STUCK ON EXCEL OFFICE FUNDAMENTALS!!!!!! I'LL GIVE BRAINLIEST TO THE FIRST RIGHT ANSWER!!!! PLEASE, I'M B
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!