Answer
$t=1.46 \times 10^3 \mathrm{y}
$
Work Step by Step
If the Sun were composed of the appropriate mixture of carbon and oxygen, the number of combustion events that could occur before the Sun burns out would be
$
\left(2.0 \times 10^{30} \mathrm{~kg}\right) /\left(7.31 \times 10^{-26} \mathrm{~kg}\right)=2.74 \times 10^{55} .
$
The total energy released would be
$
E=\left(2.74 \times 10^{55}\right)\left(6.58 \times 10^{-19} \mathrm{~J}\right)=1.80 \times 10^{37} \mathrm{~J} .
$
If $P$ is the power output of the Sun, the burn time would be
$
t=\frac{E}{P}=\frac{1.80 \times 10^{37} \mathrm{~J}}{3.9 \times 10^{26} \mathrm{~W}}=4.62 \times 10^{10} \mathrm{~s}=1.46 \times 10^3 \mathrm{y},
$
or $1.5 \times 10^3 \mathrm{y}$, to two significant figures.