Question: Q.3] Write C functions that do the followings. Using control statements (loops, if, switch ...etc) is not allowed. You are allowed to use only the
Q.3] Write C functions that do the followings. Using control statements (loops, if, switch ...etc) is not allowed. You are allowed to use only the followings:!& if not specified. For example, implement And(x,y)-x & y using only ~ and I. Note that x & y --(~x/-y). Ilence. int And (x, y) return (xI-y) a) Implement Negation(x)- x b) Implement Xor(x,y)-x ^ y using only ~ and & c) Implement OneMinus)- d) Implement swapHex (x) that swaps x's hex digits (x is of size 1 byte)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
