Question: finish code for the unsigned operations. expected output: echo Running tests... echo output = $ ( . / a . out test ) expected _

finish code for the unsigned operations.
expected output: echo "Running tests..."
echo
output=$(./a.out test)
expected_output="Binary of 5: 00000101
Binary of 9: 00001001
a =5, b =9
a&b =1
Binary: 00000001
a|b =13
Binary: 00001101
~a =250
Binary: 11111010"
if [ $?-eq 0] ; then
echo "Pass: Program exited zero"
else
echo "Fail: Program did not exit zero"
exit 1
fi
if ["$output" =="$expected_output" ] ; then
echo "Pass: Output is correct"
else
echo "Expected '$expected_output' but got: $output"
exit 1
fi
echo
echo "All tests passed."
exit 0
finish code for the unsigned operations. expected

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!