If you had a nosebleed, it is possible that the blood ran down the back of your throat and mixed with the mucus you later coughed up, unless you repeatedly coughed up blood.
In either case, you should let your parents know just in case so you can get it checked out straight away. You really have nothing to be scared of, lung cancer is very rarely diagnosed in people under 40 years of age. That being said, the sooner you get it checked out, the less you'll have to deal with.
The rest of the possibilities (TB, bronchitis) are all curable as far as I know so you really have nothing to worry about and so again I stress there really is nothing that should be keeping you from letting someone know, so get to it!