Question: // This function shoulud return a value that when printed out // in binary (which has been provided to you), is the 32-bit // two's
// This function shoulud return a value that when printed out // in binary (which has been provided to you), is the 32-bit // two's complement of the input x. You may use any method // you can come up with to do this, though the code should // be concise. int twos_complement(int x) { return x; } // This function should return 10 times the input x. You must // use both shift operations and addition, and nothing else. // X+X+X+... will NOT be accepted. int times_ten (int x) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
