There are more than 30 different causes of pneumonia, and they're grouped by the cause. The main types of pneumonia are bacterial, viral, and mycoplasma pneumonia. A cough that produces green, yellow, or bloody mucus is the most common symptom of pneumonia.