Write a C/C++ function that will return a word
consisting of the
most signicant byte of x, and the remaining bytes of y. For
operands x =
0x89ABCDEF and y = 0x76543210, this would give 0x89543210.
#include <iostream>
using namespace std;
int main() {
int b = 0x76543210;
int a = 0x89ABCDEF;
b = b << 8;
b = b >> 8;
a = a >> 24;
a = a << 24;
int ans = a | b;
cout <<"0x" <<hex << ans <<endl;
}
==================================
SEE OUTPUT
Thanks, PLEASE COMMENT if there is any concern.
Get Answers For Free
Most questions answered within 1 hours.