1. Write a function that makes a string uppercase, without directly using ASCII codes. (+1)
  2. Print integers using putchar(). (+1)
    \begin{lstlisting}
int main() {
int i = 0;
for (; i < 1000; i = i*10 + 2 + i) ...
...(i);
printf(\t==\t printInt(-i);
printf(\t==\t }
return 0;
}
\end{lstlisting}

  3. Swap the value of two varibles without creating a new variable. (+1)
  4. Test whether an integer is power of 2, without a loop. (+1)
    \begin{lstlisting}
int main() {
int i = -1;
while (++i < 10)
printf(''%d: %s\n'', i, isPower2(i) ? ''yes'' : ''no'');
return 0;
}
\end{lstlisting}

  5. Write a function that multiplies a number by 7 without using multiplication and addition opperators. (max +2)
  6. Reverse a linked list, using this function header: node* reverseList(node* head) (+1)
    \begin{lstlisting}
typedef struct node {
int value;
struct * node next;
} node...
... printnode(p);
p = reverseList(p);
printnode(p);
return 0;
}
\end{lstlisting}

William Niu 2009-06-04