\documentclass[12pt]{article}
\topmargin -10.8truemm
\textheight 218truemm
\oddsidemargin 0.0truemm
\evensidemargin 0.0truemm
\textwidth 165truemm
% remove all page numbers
\renewcommand{\thepage}{\mbox{}}
\begin{document}
\begin{center}
{\Large CSc 265---F96---Quiz 4 (Time: 20 min.)}
\end{center}
%
\begin{tabbing}
Student name:1\=\underline{\hspace{3in}}1\=Lab Section:1\=\kill
Student name:\>\underline{\hspace{3in}}\>Lab Section:\>\underline{\hspace{.75in}}
\end{tabbing}
%
\noindent In the space to the right,
provide the {\it exact output\/} of the program shown below.
Then inspect the code carefully.
Circle each fault found and provide a brief description
(no more than 10 words).
{\bf Note}:
the {\it symmetric difference\/} of sets $A$ and $B$ is
the set of all elements in $A$ or in $B$ but not in both.
{\footnotesize\begin{verbatim}
#define MAXSIZE 100
typedef struct {
   int size;
   int s[MAXSIZE];
} IntSet;

/* Compute the symmetric difference of s0 and s1; leave the result in s2.
Assumptions: 1. s0->size and s1->size are in [0..MAXSIZE-1]
             2. There are no duplicates in s0->s[0..s0->size-1] or s1->s[0..s1->size-1].
*/
void symDiff(IntSet* s0,IntSet* s1,IntSet* s2)
{
   int i,j;

   s2->size = 0;
   for (i = 0; i < s0->size; i++) {
      for (j = 0; j < s1->size; j++)
         if (s0->s[i] == s1->s[j]) break;
      if (j == s1->size)
         s2->s[s2->size++] = s0->s[i];
   }
   s2->size = 0;
   for (i = 0; i < s1->size; i++) {
      for (j = 0; j < s0->size; j++)
         if (s1->s[i] == s0->s[j]) break;
      if (j == s0->size)
         s2->s[s2->size++] = s1->s[i];
   }
}

/* Compute the symmetric difference of {2,4,6} and {4,5,6,7}. */
main() {
   static IntSet intSet0 = {3,{2,4,6}};
   static IntSet intSet1 = {5,{4,5,6,7}};
   static IntSet intSet2;
   int i;

   symDiff(&intSet0,&intSet1,&intSet2);
   for (i = 0; i < intSet2.size; i++)
      printf("%d ",intSet2.s[i]);
}
\end{verbatim}}
%
\end{document}
