MCQ Arrays
MCQ Arrays
Question 1
Which of the following is the correct usage while declaring array size?
Question 2
1. 10th
2. 9th
3. 11th
4. None
Question 3
Cell numbers or index position of a dimensional array are also known as:
1. packets
2. blocks
3. subscripts
4. compartments
Question 4
1. subscripted variable
2. actual variable
3. compound variable
4. none
Question 5
1. dots
2. element name
3. index number
4. none
Question 6
Indicate the error message which displays, if the following statement is executed :
int a[5] = {28,32,45,68,12};
1. Insufficient cells
2. Array index out of bounce
3. Elements exceeding cells
4. None
Question 7
1. assigns 37 to code[1]
2. assigns 25 to code[1]
3. assigns 38 to code[3]
4. assigns 42 to code[0]
Question 8
1. from 1 to 50
2. from 0 to 49
3. from 1 to 51
4. none
Question 9
1. m.size of (a)
2. m.elements of (m)
3. m.length
4. None
Question 10
A Single Dimensional array contains N elements. What will be the last subscript?
1. N-1
2. N
3. N+1
4. None
5.
Question 2
Question 3
Question 4
int a[4]={2,4,6,8};
for(i=0;i<=1;i++)
{
s=a[i]+a[3-i];
System.out.println(s);
}