Final answer:
Samuel Morse invented the code for telegraphs called Morse code, which represented letters of the alphabet using long and short bursts of sound.
Step-by-step explanation:
The code that Samuel Morse invented for telegraphs is Morse code. Morse code is a system in which letters of the alphabet are represented by patterns of long and short bursts of sound. It enabled the first modern mass communications device and significantly increased the speed by which information could be shared and disseminated.