When a gas is compressed, It increase the pressure since the volume of gas is decreased according to the gas laws, which increases the randomness of the gasmolecules which start to collide more frequently and hence the temperature rises. Thus, due to compressing gas both pressure and temperature increases.