I will give you a hint. Here are at least two ways to separate the two parts of the 16-bit value. First the mask-and-shift approach. To keep nine-bits of a value you can mask off everything else. I think in hexadecimal and the hex value for all nine least significant bits set is 0x1FF. To get mask everything else you can do this :
using USHORT = unsigned short;
const USHORT mask = 0x1FF;
USHORT customer = number & mask;
Then to get what is left you can AND with the complement of the first mask and then shift the value. Here's what that would look like :
const USHORT negmask = ~ mask;
USHORT account = ( number & negmask ) >> 9;
I recommend that you try this with several different values to verify it for yourself.
Another way this can be done is using bit fields and a union. Here what that would look like :
union Number
{
USHORT usv;
struct BFnumber
{
USHORT cust : 9;
USHORT acct : 7;
} bfv;
};
and then to use that you can do this :
Number custdata;
custdata.usv = number;
printf( "customer is %4d or %04X", custdata.bfv.cust, custdata.bfv.cust );
printf( "account is %4d or %04X", custdata.bfv.acct, custdata.bfv.acct );