much mimic each other, so it probably makes sense to merge them into one, or turn into master-slave pair. While here, replace unsafe gets() with fgets().