True/False Consider the following declarations as you determine if each of assignment statements 1 - 7 is valid. Answer True if the statement is valid, False otherwise. #define HALF_CENT 50 #define A_SIZE 26 char a_list[HALF_CENT], b_list[HALF_CENT], a_char = 'v'; int nums[A_SIZE], vals[A_SIZE], i = 1; 1. nums[0] = nums[25]; T 2. nums = vals + 1; F 3. a_list[50] = 'd'; F 4. b_list[30] = 0.37 * vals[1]; F 5. a_list = b_list; F 6. nums[5] = (int)a_char; T 7. for (i = 1; i <= A_SIZE; ++i) nums[A_SIZE - i] = i; T 8. If b is an array with type int elements, then the statement b += 5; F adds five to each element of b. 9. If b is an array with type int elements and the value of b[4] is 3, then the statement printf("%d\n", b[b[4] - 1]); prints one less than the value of b[3]. F 10. If b is the array in question 9, then the statement b[0] = b[4]; stores 3 in the first element of array b. T 11. If b is the array in question 9, then the statement b[0] = b[4 - 1]; stores 3 in b[0]. F 12. If b is the array in question 9, then the statement b[0] = b[4 ] - 1; stores 2 in b[0]. T 13. If b is the array in question 9, then the statement b[4] += 2; T changes the value of b[4] to 5. Multiple Choice 14. What value is returned by function result? int result(int a[], int n) { int i, r; r = 0; for (i = 1; i < n; ++i) if (a[i] > a[r]) r = i; return (r); } a. a. The subscript of the largest of the first n elements of array a. b. The value of the largest of the first n elements of array a. c. The subscript of the smallest of the first n elements of array a. d. The value of the smallest of the first n elements of array a. e. The subscript of the last element greater than its predecessor within the first n elements of array a. For questions 15 - 19 assume the following environment. #define MAX 50 int a[MAX], i, j, temp; 15. What is the effect of this program segment? for (i = 0; i < MAX / 2; ++i) { temp = a[i]; a[i] = a[MAX - i - 1]; a[MAX - i - 1] = temp; } c. a. Arranges the elements of array a in ascending order. b. Counts the number of elements of a greater than its first element. c. Reverses the numbers stored in the array. d. Puts the largest value in the last array position. e. None of the above. 16. What is the effect of the following program segment? for (i = 0; i < MAX - 1; ++i) if (a[i] > a[i + 1]) { temp = a[i]; a[i] = a[i + 1]; a[i + 1] = temp; } d. a. Arranges the elements of array a in ascending order. b. Counts the number of elements of a greater than its first element. c. Reverses the numbers stored in the array. d. Puts the largest value in the last array position. e. None of the above. 17. What is the effect of the following program segment? temp = 0; for (i = 1; i < MAX; ++i) if (a[i] > a[0]) ++temp; b. a. Arranges the elements of array a in ascending order. b. Counts the number of elements of array a greater than its initial element. c. Reverses the numbers stored in the array. d. Puts the largest value in the last array position. e. None of the above. 18. What is the maximum valid subscript value for array a? b. a. 0 b. 49 c. 50 d. a[50] e. none of the above 19. What is the minimum valid subscript value for array a? a. a. 0 b. 1 c. any negative number d. There is no minimum. e. none of the above 20. When a C program passes an array as a function argument, b. a. the value of the initial element of the array is actually passed. b. the address of the initial element of the array is actually passed. c. the entire array is copied into the function's data area. d. the addresses of the initial and final elements of the array are copied into the function's data area. e. none of the above. 21. How would you best describe the purpose of the following code? f = 0; for (i = 1; i < N; ++i) if (a[i] >= a[f]) f = i; e. a. Rearrange the first N components of array a in descending order. b. Rearrange the first N components of array a in ascending order. c. Place the largest component of array a in position N. d. Compute the value of the largest component in array a. e. Determine the subscript of the last occurrence of the largest of the first N components of array a.