According to definition of power ( current times voltage) since there is no change in charge, the power stored in a capacitor connected to a DC voltage is zero. Since energy is power times time, Energy stored is Zero too. But we know in a transient period the capacitor gets charged up when it is connected to a DC voltage and there is energy stored. if I discconected the charged capacitor and connect it to an inductor for example this charge get discharged. So how come there is stored energy but mathematically it is zero?
Power is not stored. Energy is stored. Power is the rate at which energy is transferred.
Think about your electricity meter. You get charged for kW hour usage. kW hours are "so many" kilo watts consumed x the number of hours you have consumed those kW for. You have a big number on your meter that tells you how many kWh you have accumulated over so many years. That number is your total energy usage over that period. 1 joule is 1 watt-second. 1000 joules is 1 kW-second and 3.6 M joules is 1 kWh.
If the number on your meter was unchanged over a short period of time then the power taken over that short period of time is zero.
In other words, energy can be stored (or metered or accumulated) over a period of time and the value it accumulates to remains steady even if the actual power drawn (at a particular moment in time) is zero.
You are correct, in DC operation the capacitor power is zero; the cap does no work. This means that the energy being stored during any period of time of constant voltage is zero. This does not mean that the capacitor is not storing energy, merely that the amount of energy stored in the capacitor has not changed during the monitored period.