Complete the code to declare an array of 5 integers.
int arr[[1]];The array size must be specified as 5 to create an array with 5 elements.
Complete the code to assign the value 10 to the first element of the array.
arr[[1]] = 10;
Array indexing in C++ starts at 0, so the first element is at index 0.
Fix the error in the code to correctly print the third element of the array.
std::cout << arr[[1]] << std::endl;The third element is at index 2 because indexing starts at 0.
Fill both blanks to create an array of 4 integers and assign 7 to its last element.
int arr[[1]]; arr[[2]] = 7;
The array size is 4, so the last element is at index 3 (4 - 1).
Fill all three blanks to initialize an array with values 1, 2, 3 and print the second element.
int arr[[1]] = {1, 2, 3}; std::cout << arr[[2]] << std::endl; int size = [3];
The array size is 3, the second element is at index 1, and size is 3.
