there are 12 yellow sweets
the ratio of red, yellow or green sweets are 5:4:4 then
red, yellow or green sweets be 5x ,4x &4x{suppose}
total no of sweets are 39
then.
5x+4x+4x=39
or,13x=39
or,x=39/13
x=13
then. putting value of x in yellow sweets
(4x)=4*3=12
hence there are 12 yellow sweets in the packet