Computing equation of state parameters of gases from Monte Carlo simulations