Fasting is not always effective on weight loss and has much more side effects than a person can think. Some people don't lose weight while fasting because their body switches to starvation mode and tends to store whatever they eat and so they do not lose weight. Their BMR (basal metabolic rate) drops and they start putting on weight quicker once they leave the fast. Also you deprive the body of nutrition so the body becomes really weal from inside. As the body did not get energy for a long time during fasting it tries to store all the food what we eat after fast as a method of precaution and they start putting on weight. So if you fast you lose weight instantly but the weight will surely increase more than what it was once you get back to your normal routine so losing weight via fasting is never advisable.