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

printf \"\ Binary Bitwise Operations (signed) Inn\" printf( \"%08x\ \", AAA & BB

ID: 3586137 • Letter: P

Question

printf " Binary Bitwise Operations (signed) Inn" printf( "%08x ", AAA & BBB ); printf("308x ", AAA BBB printf "808x ", AAA I BBB printf ( "%08x ", AAA 12 );

Explanation / Answer

& -> Binary AND Operator copies a bit to the result if it exists in both operands. %08x means that field-length is 8 and we want to prefix with 0’s instead of just blank spaces and x means that we want to print the result in lower –case hexadecimal. ^ -> Binary XOR Operator copies the bit if it is set in one operand but not both. | -> Binary OR Operator copies a bit if it exists in either operand. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. In this case since it is 4 the value in AAA will be moved left by 4 that is 4 times and 0’s will be appended at the right end. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. In this case since it is 4 the value in BBB will be moved left by 4 that is 4 times and 0’s will be appended at the right end. >> -> Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. In this case since it is 12 the value in AAA will be moved right by 12 that is 12 times and 0’s will be appended to the left end. >> -> Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. In this case since it is 12 the value in BBB will be moved right by 12 that is 12 times and 0’s will be appended to the left end.