Computer Science 101 Quiz B Name ______________________ 1. The correct way to access a grayscale pixel in the out_image is: a. out_image[3 * row * numcols + col] b. out_image[row * numcols + col] b c. out_image[col * numrows + row] d. out_image[3 * row * numcols + 3 * col] 2. Suppose ndx represents an offset in a grayscale image, the proper way to compute the row and column indicies of the corresponding pixel is: a. row = numrows / ndx; b. row = numrows / ndx; d col = numcols / ndx; col = numcols % ndx; c. row = numrows / ndx; d. row = numcols / ndx; col = numcols / ndx; col = numcols % ndx; 3. Identify the expression whose value is the remainder when 343 is divided by 141 a. 141 % 343 b. 143 / 343 d c. 343 / 141 d. 343 % 141 4. The minimum and maximum values pix may be assigned by this expression pix = 28 + (r + c) % 200; are: a. 0 200 b. 28 200 d c. 28 228 d. 28 227 5. Consider the problem of counting the number of instances of values between 0 and 9 in an input file. Which is the proper way to do this. a. num = fscanf(stdin, "%d", &ndx); b. num = fscanf(stdin, "%d", &ndx); while (num == 1) while (num == 1) { { ctrs[ndx] = ctrs[ndx] + 1; ctrs[ndx] = ctrs[ndx] + ndx; num = fscanf(stdin,"%d",&ndx); num = fscanf(stdin,"%d",&ndx); a } } c. num = fscanf(stdin, "%d", &ndx); d. num = fscanf(stdin, "%d", &ndx); while (num == 1) while (num == 1) { { ctrs[ndx] = ndx + 1; ctrs[ndx] = ndx; num = fscanf(stdin,"%d",&ndx); num = fscanf(stdin,"%d",&ndx); } }