lastchance is correct - you never actually call your
restaurant() function anywhere. You should have been able to tell this yourself, because when you run the program, you never see
You've been at the restaurant |
output anywhere.
Also:
1) You really should avoid using global variables. They seem convenient now, when you're writing tiny programs like this one. But as you write larger and larger programs, they become problematic. The sooner you can get out of bad habits, the better!
Instead of using global variables, you should learn how to pass data into, and back out of, functions.
2) What's the point of printing the same value 3 times in a row in
main()? You do nothing to change the value of
times between those three outputs, so how could it possibly print anything other than the same thing?