Let c be the cost and b be the number of bags. We can write the linear relationship: c=ab+d where a and d are constants.
Now for the figures: 18000=200a+d and 18000+21000=500a+d.
18000=200a+d and 39000=500a+d, so 21000=300a and a=70 (the cost of producing one bag) and 18000-14000=d=39000-35000, so d=4000 (by substitution of a in either equation).
We can now write c=70b+4000. This satisfies the cost side.
On the sales side we have a revenue equation: the revenue r=90b because the price of yam flour is set at 90 a bag. The profit, p, is revenue - cost=r-c=90b-70b-4000=20b-4000. So p=20b-4000.
The break even point is when p=0, when 20b-4000=0, so b=200. When b>200 a profit is made and when b<200 a loss is made.