How to get return value from C program and logs to file

Hi, I have written scritp which prints output from the executable to standard output as well as in a file. Here "add" is an c executable which returns
some value based on inputs.

But if tee is not used "$?" returns the return value from add exe.
If tee is used it is simply retuning 0.

echo "Running program output"
myLine="./add 1 11"
`expr "$myLine"`| tee outputfile
echo "Succ/Fail : $?"

you need to look at the system variable $PIPESTATUS

echo "Running program output"
myLine="./add 1 11"
`expr "$myLine"`| tee outputfile
echo "Succ/Fail : $PIPESTATUS"

echo "Running program output"
myLine="./add 1 11"
`expr "$myLine"`| tee outputfile
echo "Pass / Fail : $PIPESTATUS"

Thanks for your reply.
$PIPESTATUS is not printing any value when it is written in script

Please help me out

echo "Running program output"
myLine="./add 1 11"
`expr "$myLine"` > outputfile
echo "Succ/Fail:$?"

Want to print output from the exe to file and terminal at a time.
So, used `tee` command. But return status of tee is printed instead of
exe return value.
Can use pipestatus. pipestatus is printing value but need to run like "bash script.sh". I need to run the script using "sh".
Help needed.