He has 5 kilograms of peanuts and he is making 100 gram bags. So first we will turn the kilograms into grams.
1 kilogram = 1000 gram
5 kilogram = 5000 gram
Now to find out how many bags of peanuts he has to sell.
5000/100 = 50
So he has to sell 50 bags of peanuts to sell all 5000 grams.
Hope this helps :)