Post History
If you're referring to this Wikipedia page then the topology has a negative output. In that case, the problem as you have it stated in the OP, is misleading: it should be Vo=-20. With that, extract...
Answer
#1: Initial revision
If you're referring to this [Wikipedia page](https://en.wikipedia.org/wiki/Buck%E2%80%93boost_converter) then the topology has a negative output. In that case, the problem as you have it stated in the OP, is misleading: it should be Vo=**-20**. With that, extracting D will give: $$D=\dfrac{V_{out}}{V_{out}-V_{in}}=\dfrac{-20}{-20-24}=0.4545$$ Sure enough, a quick check shows the confirmation: ![D=0.4545 => Vo=-20](https://electrical.codidact.com/uploads/3iGxSbD6wdxHiz77G7DhBCAD)