                          Computer Science 101
                               Quiz L        Name ______________________

1. The number of ints created by the following declaration
      int twod[3][6];

   a. 9                                  b. 10

   c. 18                                 d. 36

2. Which of the following is the correct way to pass the address of
   row 2 of the array to a function declared as fun(int *vals);

   a.  fun(twod)                         b. fun(twod[2][0])

   c.  fun(&twod[2])                     d. fun(twod[2])


3. Which of the following array elements lies nearest in memory to
   twod[0][0]

   a. twod[0][5]                          b. twod[1][1]

   c. twod[1][0]                          d. twod[2][5]


4. Which of the following statement(s) is a correct way to read a
   value into twod[2][1]?  (Circle all that are correct)

   a. fscanf(in, "%d", twod[2][1]);    b. fscanf(in, "%d", &twod[2][1]);

   c. fscanf(in, "%d", twod[2] + 1);



5. Fix the following loop so that each row of the table will be
   printed on a separate line.

   for (i = 0; i < 3; i++)
   {



      for (j = 0; j < 3; j++)
      {
         fprintf(stderr, "%6.2lf", tab[i][j]);



      }



   }



