An enlarged heart causes them to cough as it presses on the windpipe. There can be other causes for coughing though, so best to get it checked by a vet.
I used to have a dog that fainted whenever we took her for a run. We always had to take her where there was water, she would run straight in & get wet all over, then she wouldn't faint. Her heart was fine, it was as if she just overheated.
Not all dogs with heart problems show signs of being ill. Generally, as the dog gets older, the signs become more obvious.
Dogs with heart disease may show coughing and difficulty breathing (due to the chest become full of fluid), lethargy or tiredness, and loss of appetite. Fainting can be a sign of heart failure, but this is only seen in some dogs.