Programming - C++ Language

You Are Here :: Home > C++ Language > Arrays - General Questions

 
43.

Given the following function prototype
void mystry(int list[], int size);
and the declaration
int alpha[50];
Which of the following is a valid call to the function mystry?                         


A. mystry(alpha[50]); B. mystry(alpha[],50);
C. mystry(alpha,50); D. None of these




44.

Given the following function prototype
void mystry(int list[], int size);
and the declaration
int alpha[50];
Which of the following is a valid call to the function mystry?                         


A. strange(alpha[0], alpha[1]); B. strange(alpha, beta);
C. strange(alpha[0], beta); D. strange(alpha, beta[0]);




45.

Which of the following function prototypes correctly declares a one-dimensional array and its size as formal parameters?
(i) void printList(int& [], int);
(ii) void printList(int list, int);                         


A. Only (i) B. Only (ii)
C. Both (i) and (ii) D. None of these




46.

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




47.

To design a general-purpose search function, searchList, to search a list, which of the following must be parameters of the function searchList?
(i) The array containing the list.
(ii) The length of the list.
(iii) The search item.
(iv) A Boolean variable indicating whether the search is successful.                         


A. (i) and (ii) B. (i), (ii), and (iii)
C. (ii), (iii), and (iv) D. (i), (ii), (iii), and (iv)




48.

To design a general-purpose sort function, sortList, to sort a list, which of the following must be parameters of the function sortList?
(i) The array containing the list.
(ii) The length of the list
(iii) A Boolean variable indicating whether the sort was successful.                         


A. (i) B. (ii)
C. (i) and (ii) D. (i), (ii), and (iii)




« prev

1

2

3

4

5

6

7

8

9

next »

 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on