\magnification1200\parindent=0pt
\def\problemskip{\vfill\eject}
\newcount\pn\pn=1
\def\np#1{{\bf\number\pn.}\advance\pn by1 (#1 pts.) }

\font\cc=courier at 10pt
\font\bb=cmbx12 at 14pt
\def\lb{$\{$}
\def\rb{$\}$}
\def\\{$\backslash$}
\def\begincode{\bgroup\bgroup\obeylines\cc}
\def\endcode{\egroup\egroup}

%%%%%%%%%
\centerline{\bb Math 211 Midterm}
\vskip4pt
\centerline{March 26, 1999}
\vskip 20pt
\centerline{\vtop{\hsize=3.8in\noindent\sl On my honor, I have abided by the code of honor and have
committed no act of academic dishonesty on this examination.}}
\vskip 15pt 
\noindent{\bf Name: }$\underline{\hbox to 3in{\hfil}}$
\vskip20pt\np{20}
After the declaration and initialization
\vskip10pt
{\cc char dd, *cc="Aardvark";}

\vskip10pt
compare and contrast the two statements
\vskip10pt
{\cc dd=*(++cc); }

with 

{\cc dd=++(*cc);}


\vskip20pt
In particular, what value is in {\cc dd} in each case?

\problemskip
\np{20}
When I compiled and ran the program below, I got

Hello8

on a line by itself. What happened?
How would you fix it to just print 

Hello

on a line by itself?

\vskip10pt
\begincode
\#include <stdio.h>
\vskip6pt
main(){\lb
\vskip6pt
char    cc[10];
\vskip6pt
cc[0]='H';cc[1]='e';cc[2]=cc[3]='l';
cc[4]='o';
printf("\%s\\n",cc);
\rb}
\endcode

\problemskip
\np{20}
If {\cc x=10110010} and {\cc y=01100110} are the binary
expansions of two characters, give the binary expansions of
the characters
{{\settabs\+\hskip 20pt&\hskip 20pt&\hskip 20pt\cr
\+&a.& {\cc x \& y }&{\cc =}\cr
\+&b.& {\cc x $|$ y}&{\cc =}\cr
\+&c.& {\cc x \^\ y}&{\cc =}\cr
\+&d.& {\cc \~\ \hskip-4ptx}&{\cc =}\cr
}}

\problemskip
\np{20}
Write the code for a function
{\cc char leap(short x)} which returns {\cc 0} if 
{\cc x} is not a leap year in the Gregorian
calendar and returns a {\cc 1} if it is.
Remember that a year is a Gregorian leap year if it is divisible by 4
unless it is divisible by 100, but not by 400.
Also remember to include all necessary declarations.

\problemskip
\np{20}
What is the precise output of the following program
\vskip10pt
\begincode
\#include <stdio.h>
\vskip6pt
main(){\lb
\vskip6pt
short    zz[10], ix;
\vskip6pt
for(ix=0 ; ix $<$ 10 ; ix++ ) zz[ix]=ix;
for(ix=0 ; ix $<$ 10 ; ix++ ) zz[ix]+=ix;
for(ix=9 ; ix $>$= 0 ; ix-- ) zz[9-ix]-=ix;
printf("\%3d\\t\%2d\\n" , zz[2], zz[3]);
\rb}
\endcode
%% space, minus, 3, tab, space, 0 and a newline


\end