If I remember right, getch() is defined in conio.h, which is a nonstandard C/C++ header file (although if you looked at the actual implementation of getch(), it uses standard C/C++ code). I can't remember if conio.h was included with the Dev C++ package, but assuming it is, to use getch(), you would just add "#include <conio.h>" after the line that says "#include <iostream.h>" and before the line that says "return 0;" you would add "getch();".
If that doesn't work, another way you could do it is by adding the line "#include <stdlib.h>" after "#include <iostream.h>" and add "system("pause");" before "return 0;". system() executes a command that would normally be executed at the command prompt/console. If you're working on a Windows system, that should give you a little message that says "Press any key to continue.", which will give you a chance to view your output without having the DOS window disappear too soon. Just note that the argument you give to system() ("pause" in this case) is dependent upon what OS you're running the program on, so if you compiled it under Linux and tried to run it, it wouldn't work the same way.
Hope that helps.
If that doesn't work, another way you could do it is by adding the line "#include <stdlib.h>" after "#include <iostream.h>" and add "system("pause");" before "return 0;". system() executes a command that would normally be executed at the command prompt/console. If you're working on a Windows system, that should give you a little message that says "Press any key to continue.", which will give you a chance to view your output without having the DOS window disappear too soon. Just note that the argument you give to system() ("pause" in this case) is dependent upon what OS you're running the program on, so if you compiled it under Linux and tried to run it, it wouldn't work the same way.
Hope that helps.