Reputation: 1345
How could I make a line of code that would exit out of my program after input is given by the user for a specific word?
the psuedo-code of what I have is as follows:
take input;
compare (input) to exit word;
if input is same as exit word
exit the program <------- help here;
else
rest of program;
Upvotes: 0
Views: 17643
Reputation: 36451
If the code is inside main, you can simply use return
if somewhere else use exit
Upvotes: 4