Ask Question
4 December, 04:51

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 (j=0; j < list. length; j++) if (list[j] < temp) c++;

+1
Answers (1)
  1. 4 December, 05:03
    0
    It counts the number of items in the given list that are less than Description temp:

    Explanation:

    Following are the description of the loop

    In the given question initially, the value of "j" variable is initialized to 0. After that loop will iterate less then the length of the list array. The if (list[j] < temp) checks the condition if it is true then c+ + increment the value by 1 j+ + increment the value of "j" by 1.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “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 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers