when are elements heavier than iron formed by stars?

a. as a star is first formed
b. in young stars
c. in small, old stars
d. as a dying star explodes

d. as a dying star explodes