Can goto() statements be avoided in this program -- pls place code?

So, I have relied upon the goto() statements

Please stop writing "goto" as though it were a function - it isn't.