NEW
Font size
WorksheetsArrays in CQuiz
Total questions: 10
Worksheet time: 10mins
What is the general form of a single-dimension array declaration?
type name[size];
array name[type];
name[size] type;
size[type] name;
What is the index of the first element in an array?
2
-1
0
1
How many elements can a single-dimension array hold?
Only one
From one to several
Exactly ten
Unlimited
What is the total bytes calculation for an integer array of size 5?
15
10
25
20
What is the output of the program that prints array A with elements (-1, 33, 26, -5, 9)?
1 2 3 4 5
-1 0 33 26 9
0 1 2 3 4
-1 33 26 -5 9
What is the correct syntax to declare an array of floats with 8 elements?
float a(8);
a[8] float;
float[8] a;
float a[8];
What is the output of the sorting program for the array {4.3, -2.2, 33, 51, -39.5, 2.9, 6.5, 78}?
-39.5 -2.2 2.9 4.3 6.5 33 51 78
4.3 33 51 78 -39.5 -2.2 2.9 6.5
78 51 33 4.3 2.9 -2.2 -39.5
33 51 78 4.3 2.9 -2.2 -39.5 6.5
What is the correct way to initialize an integer array with values -1, 33, 26, -5, 9?
int A[5] = {10, 20, 30, 40, 50};
int A[5] = {0, 1, 2, 3, 4};
int A[5] = {-1, 33, 26, -5, 9};
int A[5] = {1, 2, 3, 4, 5};
What is the output of the program that multiplies two arrays A and B of size 10?
The product of corresponding elements
The sum of all elements
The maximum element
The average of all elements
What is the correct way to declare an integer array of size 6?
int B[6];
int B(6);
int[6] B;
B[6] int;
