Are you on a Windows computer? If so, include
in your program, and to pause the program, write
Sleep(time_in_milliseconds)
where in your case time_in_milliseconds should be 2000.
On the other hand, if you're on a UNIX based computer, the code looks fine (no need for
).