Let us check the first part of the statement. It says that, you need "6 Printers to 24 computers",which means you need 1 printer for 4 computers. For the second part, you have 6 computers with you and among these 6, the first 4 computers will have a total of one printer and the remaining 2 will have a total of one printer.
So in mathematics
$$Computer/Printer=4$$
Now consider n, such that $n\equiv\ \text{#}computers\ (mod\ 4),\text{then }n\in \{0,1,2,3\}$, and if $n=0,$then we will assign n=4 (since 4$\in[0]$)
So our proportion in general will look like as following,
$$\frac{\text{#}computer+(4-n)Computer}{\text# printer}$$
ie $$\frac{24Computer+(4-4)Computer}{6Printer}=\frac{6Computer+(4-2)Computer}{2Printer}=4$$