Is it lung cancer, can't tell. Probably not given your age.
But, the cause of your bleeding needs to be found. It certainly CAN be as a result of your smoking. It could indicate pneumonia or even tuberculosis.
See your doctor, NOW.
If you've been coughing alot then you could have ruptured some capillaries and shortness of breathe is very common in smokers. I suggest you stop smoking its a horrible habit and leads to alot of health problems in the future. Im sure you wouldnt want to look 50 when your 40. It causes bedroom issues too!
See your doctor incase theres an underlying problem.