Consult a doctor immediately if the cough has been persistent and accompanied by symptoms such as shortness of breath, swelling in legs and ankles, rapid or irregular heartbeat, pink frothy mucus, wheezing sound when breathing and fatigue.