To print exit code of the last command type:

echo $?