Final Exam Review Question and
answers 100% correct 2025/2026
Declare an array named scores of twenty-five elements of type int . - correct answer ✔int scores[25];
Given the array a, write an expression that refers to the first element of the array . - correct answer
✔a[0]
Assume that the array arr has been declared . In addition, assume that ARR_SIZE has been defined to be
an integer that equals the number of elements in arr.
Write a statement that assigns to x the value of the next to last element of the array (x has already been
declared ). - correct answer ✔x = arr[ARR_SIZE-2];
Assume that the array monthSales of integers has already been declared and that its elements contain
sales data for the 12 months of the year in order (i.e., January, February, etc.).
Write a statement that writes to standard output the element corresponding to October.
Do not write anything else out to standard output . - correct answer ✔cout << monthSales[9];
Given that an array of int named a has been declared , assign 3 to its first element . - correct answer
✔a[0] = 3;
Assume that an array named a, containing exactly five integers has been declared and initialized .
, Write a single statement that adds ten to the value stored in the first element of the array . - correct
answer ✔a[0] += 10;
Assume that an array of int named a has been declared with 12 elements and that the integer variable k
holds a value between 0 and 6.
Assign 15 to the array element whose index is k. - correct answer ✔a[k] = 15;
Given that an array of int named a has been declared with 12 elements and that the integer variable k
holds a value between 0 and 6.
Assign 9 to the element just after a[k]. - correct answer ✔a[k+1] = 9;
Given that an array of int named a has been declared with 12 elements and that the integer variable k
holds a value between 2 and 8.
Assign 22 to the element just before a[k]. - correct answer ✔a[k-1] = 22;
Assume that an array of integers named a that contains exactly five elements has been declared and
initialized .
Write a single statement that assigns a new value to the first element of the array . This new value
should be equal to twice the value stored in the last element of the array .
Do not modify any values in the array other than the first element . - correct answer ✔a[0] = 2 * a[4];
An array of 1000 integers is declared. What is the largest integer that can be used as an index to the
array? - correct answer ✔999