Arrays

Q1:
Which of the following statements are correct about 6 used in the program?
int num[6];
num[6]=21;

A In the first statement 6 specifies a particular element, whereas in the second statement it specifies a type.

B In the first statement 6 specifies a array size, whereas in the second statement it specifies a particular element of array.

C In the first statement 6 specifies a particular element, whereas in the second statement it specifies a array size.

D In both the statement 6 specifies array size.

ANS:B - In the first statement 6 specifies a array size, whereas in the second statement it specifies a particular element of array.

The statement 'B' is correct, because int num[6]; specifies the size of array and num[6]=21; designates the particular element(7th element) of the array.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.