wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Array Quiz 2

Total questions: 10

Worksheet time: 2mins

Name
Class
Date
1.

A variable that can store multiple values of the same type

a)

Functions

b)

Classes

c)

Structures

d)

Array

2.

_______ is correctly declares an array?

a)

int array;

b)

array{10};

c)

int array[10];

d)

array array[10];

3.

How can we accesses the seventh element stored in array?

a)

array[6];

b)

array(7);

c)

array[7];

d)

array=6;

4.

If array is initialized with fewer initial values than the size declarator, what happen to the remaining elements?

a)

set to the value of the element before

b)

set to null

c)

set to 1

d)

set to 0

5.

An array with two or more arrays that contain related data with each other

a)

2 Dimensional Array

b)

Parallel Array

c)

Partial Array

d)

Function Array

6.

In array we access the value of element using index.

a)

True

b)

False

7.

Given the following declaration, where is the value 77 stored in the scores array?

int scores[] = {83, 62, 77, 97, 86}

a)

scores[2]

b)

scores[1]

c)

scores[3]

d)

scores[4]

8.

What will the following code display?

int numbers[5] = { 66, 55, 101, 99, 87};

for (int i = 2; i < 5; i++)

cout << numbers[i] << " ";

a)

87 101 99 87

b)

66 101 87

c)

55 101 99 87

d)

101 99 87

9.

In an array, every element has the same

a)

data type

b)

memory location

c)

subscript

d)

all of the above

10.

How to declare 2D array for marks that contain row and column as in picture?

a)

float marks[3][4];

b)

float marks[3][2];

c)

float marks[4][3];

d)

float marks[2][3];