Programming - C++ Language

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

 
7.

Which of the following about C++ arrays is true?
(i) All components must be of the same type.
(ii) The array index and array element must be of the same type.                         


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




8.

Which of the following about C++ arrays is true?
(i) Array components must be of the type double.
(ii) The array index must be of an integral type.                         


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




9.

Which of the following declares alpha to be an array of 25 components of the type int?
(i) int alpha[25];
(ii) int array alpha[25];                         


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




10.

Suppose you have the following declaration:
char nameList[100];
Which of the following ranges is valid for the index of the array nameList?
(i) 1 through 100
(ii) 0 through 100                         


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




11.

Suppose you have the following declaration:
int beta[50];
Which of the following is a valid element of beta?
(i) beta[0]
(ii) beta[50]                         


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




12.

Suppose you have the following declaration:
double salesData[1000];
Which of the following ranges is valid for the index of the array salesData?
(i) 0 through 999
(ii) 1 through 1000                         


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




« prev

1

2

3

4

5

6

7

8

9

next »

 
 



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