One equation that every first-year student wants to be true is $A/B\cong C\implies A\cong B\times C$, where $A$, $B$, and $C$ are algebraic structures of some kind (modules, groups, rngs, . . .). However, this is not true: set $A=\mathbb{Z}$, $B=2\mathbb{Z}$, $C=\mathbb{Z}/2\mathbb{Z}$.
In the above case, though, $B\times C$ is not too far away from $A$: there is some $D$ such that $(B\times C)/D\cong A$. In this case, $D$ can be taken to be one of the copies of $B$.
My question is, when does this hold in general? One way (although certainly not the only way) to phrase this precisely would be to ask, what are those algebraic structures $A$ such that for all $B$, there is some $C$ such that $A\cong (B\times (A/B))/C$? (This is somewhat vague, as exactly what substructures $B$ are allowed here is not explicit, but I was thinking that this data might be incorporated into the data describing $A$; e.g., $A$ as a group, or $A$ as a ring without unity, etc.)
Thank you very much in advance!