Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write c code. code should be straight-line with no conditionals, loops, or funct

ID: 3890263 • Letter: W

Question

write c code. code should be straight-line with no conditionals, loops, or function calls !!!

Assume data type int is w bits long. Unless w is given a specific value, your code should work as long as w is a multiple of 8. You can use the expression sizeof(int)<<3 to compute w.

Suppose we number the bytes in a w-bit word from 0 (least significant) to w/8 -1 (most significant) Write code for the following C function, which returns an unsigned value in which byte i of argument x has been duplicated unsigned long long extend_byte (unsigned x, unsigned i); Here are some examples showing how the function should work: extend_byte (OxAB3F56, 0) > OxAB3F5656 extend_byte (OxAB3F56, 2) > OxABAB3F56

Explanation / Answer

Below is your code: -