Mean orbital radius of earth around the sun =1.5×1011m
Timeperiod(T)=1Yr
=365×24×3600s
Let mass of the sun = Ms
Mass of the planet = m
We know,
Centripetal force = Gravitational force
mv2r=GMsmr2
v²=GMsr
(2πrT)2=GMsr
Ms=4π2r3GT2
Put the values of r , G , and T
Ms=4×(3.14)²×(1.5×1011)36.67×10−11×(365×24×3600)
≈2×1030Kg