A diatomic ideal gas is heated at constant volume until its pressure becomes 3 times.it is again heated at constant pressure until its volume is doubled.find the molar heat capacity for the whole process?

Your question does not make sense. A quantity of material can have a heat capacity, but a process does not.

The molar specific heat at constant volume for a diatomic gas is (5/2)R

(R is the ideal gas constant)

The molar specific heat at constant pressure for a diatomic gas is (7/2)R

Suppose you start out with No moles at temperature To and pressure Po. The gas initially occupies volume
Vo = N*R/Po
To triple the pressure at constant volume Vo will require tripling the absolute temperature. To then double the volume at constant pressure will require doubling the absolute temperature.
You will end up with volume 2Vo, temperature 6To and pressure 3Po. The number of moles remains the same
N = P*V/(R*T) = No

The heat needed for the process can be computed from the heat capacities of the two separate steps