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
Kryger [21]
3 years ago
15

What does the following code do? Assume list is an array of int values, temp is some previously initialized int value, and c is

an int initialized to 0. for (int j = 0; j < list.length; j++) if (list[j] < temp) c++;
a. It finds the smallest value and stores it in temp
b. It finds the largest value and stores it in temp
c. It counts the number of elements equal to the smallest value in the list
d. It counts the number of elements in the list that are less than temp
Computers and Technology
2 answers:
BigorU [14]3 years ago
6 0

Answer:

Option D is correct.

Explanation:

Option D is correct because  when the condition  if (list[j] < temp) is tested it only gets true when element in list[] array at <em>jth</em> position is less than the value in <em>temp</em> and after that it increments the value of c by this statement: c++ and so c is incremented from 0 to as much times as much elements in list[] are lesser than temp.

neonofarm [45]3 years ago
4 0

Answer:

d) It counts the number of elements in list that are less than temp        

Explanation:

Lets have a look at the code fragment.

There is a loop variable j which starts from then moves through the array length.

This loop will continue to execute till it reaches the end of the list.

Also the value of j will be incremented by 1 at the end of every iteration.

The variable c will also be incremented by 1 every time the if condition evaluates to true.  

Lets say that temp= 5 c=0 and list has the following elements: 1 2 3 4 5 6

In the first iteration the value of j=0 which is less than array length as array length is 6.

So the control enters the loop body, if statement is checks if the jth index of array is less than value of temp?

   Here list[j]=list[0] = 1

As the value of j is 0 and the element at 0 th index of array is 1

So the condition is true because 1 is less than the value of temp i.e. 5

After this the statement c++ is executed which will increment value of c by 1 so c=1.

So this loop will iterate till the end of the list is reached.

At every iteration it will be checked if the element in the list is less than the value of temp and c will keep counting the number of times this condition evaluates to true.

So it is clear that this code counts the number of elements in the list that are less than temp.

You might be interested in
Once a virus has been removed by your anti-virus program, all traces of it are gone from your computer.
pychu [463]
Im pretty sure that is false
5 0
2 years ago
5 efectos del desarrollo tecnológico en el medio ambiente
sineoko [7]

Answer:

english plzzz

Explanation:

5 0
2 years ago
15 points. Please give an actual answer and not some random thing. this is not just free points. Correct answer will receive bra
trapecia [35]

Answer:

i think its b

Explanation:

i did the test and got it right

7 0
2 years ago
Read 2 more answers
Let's say that you handle the IT systems administration for your company. There's a server inside of your organization that chec
kirill115 [55]

From server do some file transfer to client PC to sync to the server.

<u>Explanation:</u>

As IT System administrator if PC or client or workstation or laptop not connected to network more than 3 months from windows server we need to refresh the connection and redo the connection from server to the client to do sync the activities.

Moreover from domain server refresh and re sync activities to establishing the connection.

Go to client PC or workstation or desktop login log and logout from the PC and login to domain account by changing the password.

7 0
2 years ago
A technician wants to update the organization's disaster recovery plans. Which of the following will allow network devices to be
Illusion [34]

Answer:B) Archives/backups

Explanation: Archive is the group of records of data that are saved for the future use.These are the historic data that is not currently used in the actual location .

Backup is the the the copy of the group of data that is not in the original form to be used in future. Thus the correct option is option(B).

Updating of the plans by the technician cannot be done through other given options because they don't hold the historic records of the data for the renewing of the plans.

6 0
3 years ago
Other questions:
  • Numeric data is stored in ___________ for direct processing.
    10·2 answers
  • A network engineer is examining a configuration implemented by a new intern who attached an ip phone to a switch port and config
    9·1 answer
  • 1.Which type of camera tool pushes the picture back and makes it wider, exaggerating the distance between the background and for
    13·2 answers
  • Which of the following is used to describe an authentication scenario in which a user logs in using a PIN and a security token
    7·2 answers
  • Olivia is trying to save for a new laptop computer. To help her save, she should start a _____. database financial statement per
    7·2 answers
  • During the _____ of the systems development life cycle (SDLC), an information system is operating, enhancements and modification
    9·1 answer
  • AYUDAAAA!!!!! URGENTE!!!!!!1<br> ¿para que sirve la "BIG DATA"?
    9·1 answer
  • Communication protocols, sets of rules agreed to by all parties, are designed in order to:
    15·1 answer
  • The reason why our computers can get faster without getting bigger is because of...
    14·1 answer
  • Please answer.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!