12 questions
Unlike regular variables, __________ can hold multiple values.
constants
named constants
arrays
floats
Unlike regular variables, __________ can hold multiple values.
constants
named constants
arrays
floats
What is the last legal subscript that can be used with the following array?
int values[5];
0
5
6
4
Given the following declaration, where is the value 77 stored in the scores array?
int scores[] = {83, 62, 77, 97, 86}
scores[0]
scores[1]
scores[2]
scores[3]
To pass an array as an argument to a function, pass the __________ of the array.
contents
size, expressed as an integer
name
value of the first element
What will the following code display?
int numbers[5] = {99, 87, 66, 55, 101};
for (int i = 1; i < 4; i++)
cout << numbers[i] << " ";
99 87 66 55 101
87 66 55 101
87 66 55
Nothing. This code has an error.
An array of string objects that will hold five names would be declared with which of the following statements?
string names[5];
string names(5);
string names 5;
String[5] = names;
Given the following declaration, where is the value 15 stored in the nums array?
int nums[] = {83, 15, 57, 87, 80}
nums[0]
nums[1]
nums[2]
nums[3]
An array of double objects that will hold ten lengths would be declared with which of the following statements?
double length[5];
double length(10);
double length[10];
double length(9);
What will the following code display?
int numbers[5] = { 66, 55, 101, 99, 87};
for (int i = 2; i < 5; i++)
cout << numbers[i] << " ";
87 101 99 87
101 99 87
66 101 87
Nothing. This code has an error.
What is the last legal subscript (top index) that can be used with the following array?
int nums[10];
0
11
9
10