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
Among your selection in different online interfaces, which are your top three favorites?​
topjm [15]
What is this ? History or ?
6 0
3 years ago
Read 2 more answers
What is a URI (include example)
fenix001 [56]

Answer:

 URI is the uniform resource identifier and it is basically a sequence of the character which identify the physical and logical resources. The uniform resource identifier basically contain the predefined set of rules and syntax and also maintain the extensibility hierarchical schema.

There are basically two types of URI that are:

  1)  Uniform Resource Name (URN)

  2) Uniform Resource Locator (URL)

For example: HTTP protocol , file transfer protocol (FTP).

 

6 0
2 years ago
Write a Python program to solve the problem described above. Define a function satisfactory_meal(Meal) which takes a single para
kompoz [17]

def dx(fn, x, delta=0.001):

   return (fn(x+delta) - fn(x))/delta

def solve(fn, value, x=0.5, maxtries=1000, maxerr=0.00001):

   for tries in xrange(maxtries):

       err = fn(x) - value

       if abs(err) < maxerr:

           return x

       slope = dx(fn, x)

       x -= err/slope

   raise ValueError('no solution found')

3 0
1 year ago
When a business is using methods that help it use its time and resources the best they can, what are they exercising?
maria [59]
<span>B. Efficiency

(</span><span>effective training </span><span>techniques)</span>
3 0
3 years ago
Read 2 more answers
Factor completely: 4y^2 - y - 3
notsponge [240]

Answer:

(4y + 3)(y - 1)

Explanation:

4 {y}^{2}  - y  - 3

4 {y}^{2}  - 4y + 3y - 3

4y(y  - 1) + 3(y - 1)

(4y + 3)(y - 1)

7 0
2 years ago
Read 2 more answers
Other questions:
  • 2. Write the binary representation of number 1037.379 in IEEE 754 standard in single precision. Express the result in binary, oc
    7·1 answer
  • The gaining of unauthorized access to data in a<br> system or computer:
    11·1 answer
  • Write a function called printbackwards() that will work with a c++ string
    14·1 answer
  • You maintain an RODC running Windows Server 2012 R2 at a branch office, and you want Juanita, who has solid computer knowledge,
    13·1 answer
  • Each webpage is assigned a(n) ______, an address that identifies the location of the page on the Internet.
    6·1 answer
  • What is a relationship between a object and a class?
    7·1 answer
  • Consider two communication technologies that use the same bandwidth, but Technology B has twice the SNR of technology A. If tech
    14·1 answer
  • Hellpppp please I need it!
    15·1 answer
  • a ____ is a window inside the word window that can remain open and visible while you work in a document.
    14·1 answer
  • What do hard disk drive use to store data
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!