Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Day 6 Array

Total questions: 10

Worksheet time: 8mins

Name
Class
Date
1.

An entire array is always passed by ___ to a called function.

a)

A) Call by value

b)

B) Call by reference

c)

C) Address relocation

d)

D) Address restructure

2.

What does the following declaration mean?

int (*ptr)[10];

a)

ptr is array of pointers to 10 integers

b)

ptr is a pointer to an array of 10 integers

c)

ptr is an array of 10 integers

d)

ptr is an pointer to array

3.

a)

2,1,15

b)

1,2,5

c)

3,2,15

d)

2,3,20

4.

a)

2, 3, 4, 5

b)

1, 2, 3, 4

c)

0, 1, 2, 3

d)

3, 2, 1 0

5.

a)

5

b)

4

c)

6

d)

7

6.

A one dimensional array A has indices 1....75.Each element is a string and takes up three memory words. The array is stored starting at location 1120 decimal. The starting address of A[49] is

a)

1167

b)

1164

c)

1264

d)

1169

7.

Minimum number of interchange needed to convert the array 89,19,40,14,17,12,10,2,5,7,11,6,9,70, into a heap with the maximum element at the root is

a)

0

b)

1

c)

2

d)

3

8.

Minimun number of comparison required to compute the largest and second largest element in array is

a)

n-[log₂n]-2

b)

n+[log₂n-2]

c)

log₂n

d)

None of these

9.

If storage class is missing in the array definition, by default it will be taken to be

a)

automatic

b)

external

c)

static

d)

either automatic or external depending on the place of occurrence

10.

he following program


main( )

{

static int a[ ] = { 7, 8, 9 } ;

printf( "%d", 2[ a ] + a[ 2 ] ) ;

}

a)

results in bus error

b)

results in segmentation voilation error

c)

will not compile successfully

d)

none of these