Two shelf counts need to trade places. The function receives an address for each count. Save the value at left in a temporary integer before overwriting it, then put that saved value at right. Swapping the pointer parameters themselves would only exchange local copies of the addresses; the caller's integers would stay put.
void swap_counts(int *left, int *right) above main using a temporary integer and dereferences to exchange the pointed-to values. Keep the supplied call; it must print A: 9, B: 4 followed by a newline.Test by changing the starting counts locally, then restore them.
Save *left, set *left = *right, then set *right = saved.