Q:

Weird C-shell return code for evaluating 1-1

I am doing this in csh
set it = `expr 1 - 1`
echo $?

It sets it to 0, but the error code returned is 1. Why is the error code not 0 if the expression evaluated correctly and the answer was set correctly?
On the other hand if I had 
set it = `expr 2 - 1`
echo $?

then the error code is 0. What is the problem with evaluating 1-1? 

A:

Because expr is weird. The same happens with any expression that evaluates to zero.
Quoting the man page:

Exit status is 0 if EXPRESSION is neither null nor 0, 1   if  EXPRESSION
  is  null   or  0,  2 if EXPRESSION is syntactically invalid, and 3 if
  an error occurred.

Shell arithmetic is preferable.
@ it = 1 - 1
echo $? : $it
0 : 0

