                          Computer Science 101
                                Quiz K      Name ______________________

For problems 1 and 2 assume that the variable loc was declared
    int *loc
and has been set to the address of an element in an array of ints.

1. The proper way to print the value of the current integer is:

   a. printf("%d \n", &loc);             b. printf("%d \n", loc);

   c. printf("%d \n", *loc);

2. The proper way to read an element into the array is:

   a. scanf("%d", &loc);             b. scanf("%d", loc);

   c. scanf("%d", *loc);


3. Given the following declarations

   int x;
   int *p;

   circle all that are syntactically correct:

   a.  p = *x;                      b. x = *p;

   c.  p = &x;                      d. *p = &x;


4. Complete the following function:
   (hint: it requires three simple assignment statements)

   void swapper(int *x, int *y)  // swap values pointed to by x and y
   {
      int temp;



















   }



