Not clear what you mean by "exit command".
Do you mean to ask the user if he/she wants to exit the login program?
Or do you mean to exit your program, if for example the user enters the wrong password?
PLEASE ALWAYS 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.
exit() and terminate() depending on your intent and needs. These are abused a lot and were really meant to be used for critical fails. I prefer to find a way to exit the program normally, via a return in main, using some logical path from the failure back out. That isn't always possible, but try to cut that path first.