WorksheetsIntroduction to Arrays and Arduino
Total questions: 4
Worksheet time: 2mins
Which statement best defines an array in programming?
A collection of unrelated data elements stored randomly in memory
A collection of similar data elements stored at contiguous (sequential) memory locations
A single variable that can change its data type automatically
A file that holds multiple programs
Based on the example int myPins[5] = {2, 4, 8, 3, 6};, what is the valid index of the last element in this array?
4
5
0
6
Consider the 1D array declaration: int num[4] = {2, 1, 4, 5}; and int val[2]; In the setup, val[0] is assigned num[1] + num[3]. What value will be stored in val[0]?
3
6
7
9
char name[5][4]={
{'t','r','e','e'},
{'b','o',’w','1'},
{'h','a','t'},
{'m','i','c','w'},
{'t','o','o','n'}
};
2D
3D
1D
none of these
