I mean on the executable file. It just displays the results and quickly flashes away, cin.get() has no effect and system("PAUSE") is undeclared.
I never found a single sure way to pause effectively. Is there a method that works all the time? Sometimes cin.get() gets skipped even in the code itself. The IDE I am using is Code Blocks if that matters any.
It is very problematic to use cin.get(); and similar functions to pause the program because that assumes there is nothing left to read from cin and that no error flags are set. Streams are not designed for this.
The reason system("PAUSE") didn't work for you is probably that you didn't include <cstdlib> and/or didn't add std:: in front, std::system("PAUSE"). I know many people hate system("PAUSE") but it is far better than using streams and much easier to use for beginners. Just be aware that system("PAUSE") only works on Windows and that you should probably not use it in "real" programs that you distribute to others.