@ akshat
i think u can recall this equation
PV = NRT , THE GAS WHICH OBEYS THIS equation is called as ideal gas .
and what u need to understand that if we taken volume of the gas as constant , and n and r are always constant in that case , p is directly proportional to t .
imageine a situation ,
suppose i have a beaker with 6 mole of molecule inside it and its fixed by a piston .
and i will press that piston downward , in that case i am increaseing the pressure ,
and the area that are avaliable for the random movement of molecule will be decrease in that case , and if so,
then molecule will collide frequently and due to the friction and collision force , the temp of the system will increased .
I THINK U UNDERSTOOD IT ,
IF NOT THEN LET ME KNOW , I WILL GIVE ANATHOR EXAMPLE
ALL THE BEST ..