wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSNP-04103 Chapter 8 - NB - Arrays

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

How many different data types can a single C++ array have?.

a)

Two

b)

One

c)

Infinite

d)

Depends

2.

How do you reference individual members of an array?.

a)

By the name

b)

By the number of elements

c)

By the subscript

d)

By the value of the array

3.

What is the subscript number for the first element of an array?

a)

0

b)

1

c)

n-1

d)

1-n

4.

Arrays are stored in:

a)

Hard drive

b)

External files

c)

Consecutive memory locations

d)

a random memory location

5.

Are there any limitations for the data types that can be used in an array?.

a)

No

b)

Yes

6.

A subscript can be only:

a)

A Float

b)

An Integer

c)

An Integer or Integer expression

d)

A long long double

7.

The last subscript of an array is:

a)

n

b)

n-1

c)

long integer

d)

float

8.

What is the size of the following array: int years [ ] = {2000,1999,1998,1997};

a)

0

b)

{2000,1999,1998,1997}

c)

3

d)

4

9.

What is the result of the following commands:

string name = "Simon Bolivar";

cout << name[6];

a)

space

b)

B

c)

S

d)

o

10.

How many dimensions can an array have?.

a)

One

b)

Two

c)

Infinity, but it can get complicated after two

d)

No more than three