have a bad cold and coughing up blood

Coughing up blood (hemoptysis) can be a sign of a serious medical condition. Infections, cancer, and problems in blood vessels or in the lungs themselves can be responsible. Coughing up blood generally requires medical evaluation unless the hemoptysis is due to bronchitis.

There are many potential reasons for coughing up blood. Causes for coughing blood include:

Bronchitis (acute or chronic), the most common cause of coughing up blood. Hemoptysis due to bronchitis is rarely life-threatening.
Bronchiectasis
Lung cancer or non-malignant lung tumors
Use of blood thinners (anticoagulation)
Pneumonia
Pulmonary embolism
Congestive heart failure, especially due to mitral stenosis
Tuberculosis
Inflammatory or autoimmune conditions (lupus, Wegener’s granulomatosis, microscopic polyangiitis, Churg-Strauss syndrome, and many others)
Pulmonary arteriovenous malformations (AVMs)
Crack cocaine
Trauma, such as a gunshot wound or motor vehicle accident
Dieulafoy’s disease

Hemoptysis can also come from bleeding outside the lungs and airways. Severe nosebleeds or vomiting of blood from the stomach can result in blood draining into the windpipe (trachea). The blood is then coughed up, appearing as hemoptysis.

In many people with hemoptysis, no cause is ever identified. Most people with unexplained hemoptysis are no longer coughing up blood six months later.

Hemoptysis Tests

In people who are coughing up blood, testing focuses on determining the rate of bleeding and any risk to breathing. The cause for hemoptysis must then be identified. Tests for coughing up blood include:

History and physical examination. By talking to and examining someone who is coughing up blood, a doctor gathers clues that help identify the cause.

Chest X-ray. This test may show a mass in the chest, areas of fluid or congestion in the lungs, or be completely normal.

Computed tomography (CT scan). By producing detailed images of structures in the chest, a CT scan can reveal some causes for coughing up blood.

Bronchoscopy . A doctor advances an endoscope (flexible tube with a camera on its end) through the nose or mouth into the windpipe and airways. Using bronchoscopy, a doctor may be able to identify the cause of hemoptysis.

Complete blood count (CBC). A test of the number of white and red blood cells in the blood, along with platelet