Question: For each function below, trace through it with reasonably small integer values. What does each function do? Requirement: You should assume integers are only 8

For each function below, trace through it with reasonably small integer values. What does each function do? Requirement: You should assume integers are only 8 bits for the purpose of this exercise. The sign bit is the leftmost of the 8 bits. int mystery1(int a, int b) { int c = a - b, d = ( >> 7) & 1, mystery = d.c.d; return mystery: } Trace: mystery1(3, 7) returns Trace: mystery1(8, 7) returns Summary: int mystery2(int x) { return (x && !(x & (x - 1))); } Trace: mystery2(1) returns Trace: mystery2(2) returns Trace: mystery2(3) returns Trace: mystery2(4) returns Trace: mystery2(5) returns Trace: mystery2(6) returns Trace: mystery2(7) returns Trace: mystery2(8) returns Summary: int mystery3(int x, int y) { int s, C; S = x^y; C=X& y; while (cle) { C = c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
