Hard-boiled eggs contain sulfur and iron, which can produce a pungent odor when cooked. While sulfur in eggs does not directly cause increased gas or bloating, it can contribute to the unpleasant smell of gas. Cooking methods that reduce sulfur content, such as poaching eggs with vinegar or lemon, can help minimize foul-smelling gas.