Your program appears to work.
Did you have a specific question?
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
7:35: error: 'printf' was not declared in this scope
8:13: error: 'gets' was not declared in this scope
9:19: error: 'strlen' was not declared in this scope
You are missing #include < ... > statements relevant to the functions named at the lines in the error report