Programming - Arrays - Discussion

You Are Here :: Home > C++ Language > Arrays - Discussion

 



Q.

Consider the following function definition.
int strange(int list[], int listSize, int item)
{
int count;
for(int j = 0; j < listSize; j++)
if(list[j] == item)
count++;
return count;
}
Which of the following statements best describe the behavior of this function?                         


A. This function returns the number of values stored in list. B. This function returns the sum of all the values of list.
C. This function returns the number of times item is stored in list. D. None of these

Answer: Option A
Explaination:

 


No Explanation




Discussion

Your Comments Goes here...
NameDiscussion