NEW
Font size
WorksheetsTopic 4 Array
Total questions: 10
Worksheet time: 5mins
Sequence of objects that have same type, is called
function
Stack
Array
Operator
Choose a declaration of C++ array with 6 integer value
int Nombor =6;
int Nombor[6];
integer Nombor[6];
array int Nombor[6];
Choose the INCORRECT statement related to the declaration of the following array.
int score[]={10,20,30,40};
The element size of the array is 4
score [2]=20
The type of each element is integer
The name of array is score
float a[3] = {10.2, 33.4, 44.4};
This is an example of
Initializing variables
Initializing array
declaring variables
declaring array
float costnum={25.99, 14.55, 36.65, 25.25, 45.99, 4.9, 17.85};
What is the value of costnum after the following statement is executed?
cout<<costnum[4];
4.99
25.25
33.65
45.99
Elements of an array are numbered as 0,1,2,3? these numbers are called
Members
Element
Index
Value
Which of the following is a two-dimensional array with 5 columns and 3 rows?
array anarray[5][3];
array anarray[3][5]
int anarray[5][3]
int anarray[3][5]
int a[5] [2] = {{0,3}, {1,2},{2,4}, {7,6},{4,8}};
cout<<a[2][1];
2
4
1, 2
2, 4
What is the index variable for the element at the first row and first column in array a?
a[0][0]
a[1][1]
a[0][1]
a[1][0]
How many elements of array int[5][5];?
10
15
20
25
