Since your friends were hospitalized, I guess they had case of bacterial meningitis.
Coughing and sneezing, oral contact with shared items such as cigarettes or drinking glasses, or intimate contact such as kissing, are ways to transmit one of the most common bacteria causing meningitis (Streptococcus pneumoniae and Neisseria meningitidis)
It is very possible that both of them get infected from you, cause many normal healthy people become carriers of these bacteria and often do not experience any symptoms.
Very rarely, if your immune system becomes suppressed or you get ill with other respiratory disease, the meningitis bacteria will invade your body, causing disease.