Filters
Question type

Study Flashcards

After the following statements execute,what are the contents of matrix? int matrix[3][2]; Int j,k; For (j = 0; j < 3; j++) For (k = 0; k < 2; k++) Matrix[j][k] = j + k;


A)
0 0
1 1
2 2

B)
0 1
2 3
4 5

C)
0 1
1 2
2 3

D)
1 1
2 2
3 3

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

Complete the following statement so that it outputs the array sales. double sales[10]; int index; for (index = 0; index < 10; index++) cout << ____________________ << " ";

Correct Answer

verifed

verified

Suppose list is a one dimensional array of size 25,wherein each component is of type int.Further,suppose that sum is an int variable.The following for loop correctly finds the sum of the elements of list. sum = 0; for (int i = 0; i < 25; i++) sum = sum + list;

A) True
B) False

Correct Answer

verifed

verified

In a two-dimensional array,the elements are arranged in a table form.

A) True
B) False

Correct Answer

verifed

verified

A collection of a fixed number of elements (called components) arranged in n dimensions (n>=1) is called a(n) ____.


A) matrix
B) vector
C) n-dimensional array
D) parallel array

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

Assume you have the following declaration char nameList[100];.Which of the following ranges is valid for the index of the array nameList?


A) 0 through 99
B) 0 through 100
C) 1 through 100
D) 1 through 101

E) None of the above
F) B) and D)

Correct Answer

verifed

verified

Which of the following statements declares alpha to be an array of 25 components of the type int?


A) int alpha[25];
B) int array alpha[25];
C) int alpha[2][5];
D) int array alpha[25][25];

E) All of the above
F) A) and D)

Correct Answer

verifed

verified

Arrays can be passed as parameters to a function by value,but it is faster to pass them by reference.

A) True
B) False

Correct Answer

verifed

verified

Given the following declaration: int j; int sum; double sale[10][7]; Which of the following correctly finds the sum of the elements of the fourth column of sale?


A) sum = 0;
for(j = 0; j < 7; j++)
\quad\quad sum = sum + sale[j][3];
B) sum = 0;
for(j = 0; j < 7; j++)
\quad\quad sum = sum + sale[j][4];
C) sum = 0;
for(j = 0; j < 10; j++)
\quad\quad sum = sum + sale[j][4];
D) sum = 0;
for(j = 0; j < 10; j++)
\quad\quad sum = sum + sale[j][3];

E) A) and D)
F) All of the above

Correct Answer

verifed

verified

The header file string contains the function ____________________,which converts a value of type string to a null-terminated character array.

Correct Answer

verifed

verified

Showing 41 - 50 of 50

Related Exams

Show Answer