First, lets find the volume of the tank. Since the tank has a shape of a rectangular prism, then the volume is:
[tex]\begin{gathered} V=l\cdot w\cdot h \\ l=20 \\ w=15 \\ h=10 \\ \Rightarrow V=(20)(15)(10)=3000 \\ V=3000\operatorname{cm}^3 \end{gathered}[/tex]we have that the volume of the tank is 3000 cm^3. Since the generator will run 2 hours on a liter of gas, then:
[tex]\begin{gathered} 3000\operatorname{cm}^3=3\text{ liters} \\ \Rightarrow(3\text{ liters)(2 hours) = 6 hours} \end{gathered}[/tex]therefore, the generator will run for 6 hours