write a Cfunction that would return the least significant byte and the mostsignificant byte of a passed-in int
Solution
#include <stdio.h>void least_most(int n, int *least, int *most) { *most = (n >> 24) & 0xFF; *least = n & 0xFF;}int main() { int n = 0x1D0000A7; int least, most; least_most(n, &least, &most); printf(“Most significant byte is 0x%xn”, most); printf(“Least significant byte is 0x%xn”, least); return 0;}
Most
OR
OR