If it's just to read the output, you don't need the program to stay "alive", just run it from a command prompt window and the output will remain visible. You can also use a debugger to break execution at a particular point.
There are plenty of ways, good and bad, to do it with code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World! ";
cin.get(); // Wait for some input, as suggested by PigBen
return 0;
}
or:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World! ";
Sleep(1000); // one second
return 0;
}
or, even though this is a Bad Idea:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World! ";
while (true) { }
return 0;
}
What are you trying to accomplish?
Edited to note that infinite loops are bad, even though they'll technically keep the program alive forever.