CSCE 121 Chapter Notes - Chapter 8: Dynamic Array, Include Directive, Parallel Array
Document Summary
True/false: all components of an array are of the same data type. Ref: 507: the array index can be any integer less than the array size. Ref: 509: the statement int list[25]; declares list to be an array of 26 components, since the array index starts at 0. Ref: 509: given the declaration int list[20]; the statement list[12] = list[5] + list[7]; updates the content of the twelfth component of the array list. Pts: 1: suppose list is a one dimensional array of size 25, wherein each component is of type int. Further, suppose that sum is an int variable. The following for loop correctly finds the sum of the elements of list. sum = 0; for (int i = 0; i < 25; i++) sum = sum + list; Pts: 1: if an array index goes out of bounds, the program always terminates in an error.