Einstein put forward the mass-energy equation E=mc2. Can anybody explain why c is squared(2)?Also derive the equation give above.Thanks.

The formula requires c^2 to preserve the units.

c is velocity, measured in m/s

energy E is measured in Joules, which are Force * distance.

Force is mass * acceleration. So,

E = (kg)(m/s^2)(m) = kg*(m/s)^2 = Mc^2

For the derivation, just read any introduction to special relativity. A simple web search will provide many such.