Pneumonia, a common respiratory infection affecting the lungs, can be caused by various factors such as bacteria, viruses, fungi, or…