Why do we fart? Foods and eating habits to avoid farting too much

Why do we fart? Foods and eating habits to avoid farting too much