wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Topic 4 Array

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Sequence of objects that have same type, is called

a)

function

b)

Stack

c)

Array

d)

Operator

2.

Choose a declaration of C++ array with 6 integer value

a)

int Nombor =6;

b)

int Nombor[6];

c)

integer Nombor[6];

d)

array int Nombor[6];

3.

Choose the INCORRECT statement related to the declaration of the following array.


int score[]={10,20,30,40};

a)

The element size of the array is 4

b)

score [2]=20

c)

The type of each element is integer

d)

The name of array is score

4.

float a[3] = {10.2, 33.4, 44.4};


This is an example of

a)

Initializing variables

b)

Initializing array

c)

declaring variables

d)

declaring array

5.

float costnum={25.99, 14.55, 36.65, 25.25, 45.99, 4.9, 17.85};


What is the value of costnum after the following statement is executed?

cout<<costnum[4];

a)

4.99

b)

25.25

c)

33.65

d)

45.99

6.

Elements of an array are numbered as 0,1,2,3? these numbers are called

a)

Members

b)

Element

c)

Index

d)

Value

7.

Which of the following is a two-dimensional array with 5 columns and 3 rows?

a)

array anarray[5][3];

b)

array anarray[3][5]

c)

int anarray[5][3]

d)

int anarray[3][5]

8.

int a[5] [2] = {{0,3}, {1,2},{2,4}, {7,6},{4,8}};

cout<<a[2][1];

a)

2

b)

4

c)

1, 2

d)

2, 4

9.

What is the index variable for the element at the first row and first column in array a?

a)

a[0][0]

b)

a[1][1]

c)

a[0][1]

d)

a[1][0]

10.

How many elements of array int[5][5];?

a)

10

b)

15

c)

20

d)

25