some C code which converts user input into morse code