I'm sorry, but your "program" is not a program. It is a monolithic monstrosity. You need to study structured programming principles before attempting to do any programming at all.
After that, study what consitiutes program "robustness," and how to do it.
Finally, study error handling. Good luck.