wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C++ Array Quiz

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

To access an array element, use the array name and the element's

a)

data type

b)

subscript

c)

name

d)

value

2.

A two-dimensional array is like _____ put together.

a)

an array and a function

b)

several identical arrays

c)

two functions

d)

two arrays of different types

3.

A two-dimensional array can be viewed as _______ and ________.

a)

rows, columns

b)

arguments, parameters

c)

increments, derements

d)

All of these

4.

Which of the following is a valid C++ array definition?

a)

int scores [0];

b)

float $payments [10];

c)

int readings [4.5];

d)

int scores [10];

5.

An array can store a group of values, but the values must be .....

a)

the same data type

b)

each of a different data type

c)

constants

d)

integers

6.

To assign the contents of one array to another, you must use

a)

the assignment operator with the array names

b)

the equality operator with the array names

c)

a loop to assign the elements of one array to the other array

d)

Any of these

7.

To pass an array as an argument to a function, pass the _________ of the array.

a)

contents

b)

size, expressed as an integer

c)

name

d)

value of the first element

8.

What is a array?

a)

An array is a series of elements of the same type in contiguous memory locations

b)

An array is a series of element

c)

An array is a series of elements of the same type placed in non-contiguous memory locations

d)

None of the mentioned

9.

The individual values contained in array are known as

a)

parts

b)

elements

c)

numbers

d)

constants

10.

Unlike regular variables, these can hold multiple values.

a)

array

b)

named constants

c)

constants

d)

floating-point variables