The main function of the alveoli is the exchange of carbon dioxide for oxygen in the lungs. Alveoli are small air sacs of the respiratory system. For this gas exchange to occur, air must travel through different parts of the respiratory system.
As air is inhaled through the nostrils, it passes from the trachea to the bronchi of both lungs. From here, the air travels to small tubes called bronchioles and finally to the alveoli. The air goes through the alveolar membrane and is absorbed into the blood. Oxygen is then separated from carbon dioxide in the blood. Through exhalation, carbon dioxide is expelled from the alveoli and also removed from the body.